Skip to content

Commit

Permalink
formatted PR and updated to v1.2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
JohnstonCode committed Nov 27, 2017
1 parent bfcddca commit cdca7cc
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 13 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
# **v1.2.0**

## What's New

* @edgardmessias added output channel

# **v1.1.0**

## What's New
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "svn-scm",
"displayName": "SVN",
"description": "Integrated Subversion source control",
"version": "1.1.0",
"version": "1.2.0",
"publisher": "johnstoncode",
"engines": {
"vscode": "^1.17.0"
Expand Down
12 changes: 6 additions & 6 deletions src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,9 @@ import { toDisposable } from "./util";
function activate(context: ExtensionContext) {
const disposables: Disposable[] = [];


const outputChannel = window.createOutputChannel('SVN');
const outputChannel = window.createOutputChannel("Svn");
disposables.push(outputChannel);

const svn = new Svn();
const model = new Model(svn);
const contentProvider = new SvnContentProvider(model);
Expand All @@ -25,9 +24,10 @@ function activate(context: ExtensionContext) {
);

const onOutput = (str: string) => outputChannel.append(str);
svn.onOutput.addListener('log', onOutput);
disposables.push(toDisposable(() => svn.onOutput.removeListener('log', onOutput)));

svn.onOutput.addListener("log", onOutput);
disposables.push(
toDisposable(() => svn.onOutput.removeListener("log", onOutput))
);
}
exports.activate = activate;

Expand Down
13 changes: 7 additions & 6 deletions src/svn.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { window } from "vscode";
import * as cp from "child_process";
import * as iconv from "iconv-lite";
import * as jschardet from "jschardet";
import { EventEmitter } from 'events';
import { EventEmitter } from "events";

interface CpOptions {
cwd?: string;
Expand All @@ -12,20 +12,21 @@ interface CpOptions {

export class Svn {
private _onOutput = new EventEmitter();
get onOutput(): EventEmitter { return this._onOutput; }
get onOutput(): EventEmitter {
return this._onOutput;
}

private log(output: string): void {
this._onOutput.emit('log', output);
this._onOutput.emit("log", output);
}

async exec(cwd: string, args: any[], options: CpOptions = {}) {
if (cwd) {
options.cwd = cwd;
}


if (options.log !== false) {
this.log(`svn ${args.join(' ')}\n`);
this.log(`svn ${args.join(" ")}\n`);
}

let process = cp.spawn("svn", args, options);
Expand Down

0 comments on commit cdca7cc

Please sign in to comment.