diff --git a/CHANGELOG.md b/CHANGELOG.md index 1c4007d6..d8ac9098 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,9 @@ +# **v1.2.0** + +## What's New + +* @edgardmessias added output channel + # **v1.1.0** ## What's New diff --git a/package.json b/package.json index 08aa82fe..d8fb4ed8 100644 --- a/package.json +++ b/package.json @@ -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" diff --git a/src/extension.ts b/src/extension.ts index eb6508a6..314392ca 100644 --- a/src/extension.ts +++ b/src/extension.ts @@ -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); @@ -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; diff --git a/src/svn.ts b/src/svn.ts index 9bf16765..2c761662 100644 --- a/src/svn.ts +++ b/src/svn.ts @@ -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; @@ -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);