Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions tasks/commandLineArguments.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,13 @@
import * as minimist from 'minimist';
import * as path from 'path';

let argv = minimist(process.argv.slice(2));
let argv = minimist(process.argv.slice(2), {
boolean: ['retainVsix']
});

export const commandLineOptions ={
outputFolder: makePathAbsolute(argv['o']),
export const commandLineOptions = {
retainVsix: !!argv['retainVsix'],
outputFolder: makePathAbsolute(argv['o']),
codeExtensionPath: makePathAbsolute(argv['codeExtensionPath'])
};

Expand Down
10 changes: 9 additions & 1 deletion tasks/offlinePackagingTasks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import { PlatformInformation } from '../src/platform';
import { DownloadAndInstallPackages } from '../src/packageManager/PackageManager';
import NetworkSettings from '../src/NetworkSettings';
import { GetRunTimeDependenciesPackages } from '../src/CSharpExtDownloader';
import { commandLineOptions } from '../tasks/commandLineArguments';

gulp.task('vsix:offline:package', async () => {
del.sync(vscodeignorePath);
Expand All @@ -37,7 +38,14 @@ gulp.task('vsix:offline:package', async () => {
});

async function doPackageOffline() {
cleanSync(true);
if (commandLineOptions.retainVsix) {
//if user doesnot want to clean up the existing vsix packages
cleanSync(false);
}
else {
cleanSync(true);
}

util.setExtensionPath(codeExtensionPath);
const packageJSON = getPackageJSON();
const name = packageJSON.name;
Expand Down
1 change: 1 addition & 0 deletions test/releaseTests/offlinePackage.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ suite("Offline packaging of VSIX", function () {
let args: string[] = [];
args.push(path.join("node_modules", "gulp", "bin", "gulp.js"));
args.push("package:offline");
args.push("--retainVsix");// do not delete the existing vsix in the repo
args.push(`-o`);
args.push(tmpDir.name);
invokeNode(args);
Expand Down