Skip to content

Commit

Permalink
Add progress
Browse files Browse the repository at this point in the history
  • Loading branch information
Ecmel Ercan authored and Ecmel Ercan committed Jul 25, 2016
1 parent 3b80180 commit ff85405
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 8 deletions.
18 changes: 11 additions & 7 deletions extension.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,20 @@

// (c) 2016 Ecmel Ercan

var vscode = require('vscode');
var vsc = require('vscode');
var archiver = require('archiver');
var parse = require('parse-gitignore');
var fs = require('fs');
var path = require('path')

function activate(context) {

var disposable = vscode.commands.registerCommand('extension.archive', function () {
var disposable = vsc.commands.registerCommand('extension.archive', function () {

var rootPath = vscode.workspace.rootPath;
var rootPath = vsc.workspace.rootPath;

if (!rootPath) {
vscode.window.showErrorMessage('Archiver works for folders only.');
vsc.window.showErrorMessage('Archiver works for folders only.');
return;
}

Expand All @@ -31,15 +31,19 @@ function activate(context) {
var archive = archiver('zip');

output.on('error', function (err) {
vscode.window.showErrorMessage(err.message);
vsc.window.showErrorMessage(err.message);
});

archive.on('error', function (err) {
vscode.window.showErrorMessage(err.message);
vsc.window.showErrorMessage(err.message);
});

archive.on('end', function () {
vscode.window.showInformationMessage('Archived to ' + archivePath);
vsc.window.showInformationMessage('Archived to ' + archivePath);
});

archive.on('entry', function (entry) {
vsc.window.setStatusBarMessage('Archiving ' + entry.name, 1000);
});

archive.pipe(output);
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": "vscode-archiver",
"displayName": "Archiver",
"description": "Workspace folder archiver",
"version": "0.0.14",
"version": "0.0.15",
"publisher": "ecmel",
"license": "MIT",
"homepage": "https://github.com/ecmel/vscode-archiver",
Expand Down

0 comments on commit ff85405

Please sign in to comment.