Skip to content

Commit

Permalink
Improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
shanaccelirate committed Oct 9, 2018
1 parent 5811d1e commit a2f096b
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 30 deletions.
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,8 @@
"devDependencies": {
"@types/fs-extra": "^5.0.4",
"@types/node": "^10.7.0",
"@types/chai":"4.1.6",
"@types/mocha": "^5.2.0",
"chai": "^4.2.0",
"mocha": "^5.2.0",
"prettier": "^1.14.2",
Expand Down
3 changes: 2 additions & 1 deletion package.nls.json
Original file line number Diff line number Diff line change
Expand Up @@ -98,5 +98,6 @@
"common.placeholder.multipleGist": "Gist Name (e.g : Personal Settings)",
"common.prompt.multipleGist": "Allows you to identify the settings if you have multiple gist.",
"common.prompt.enterGistId": "Enter Gist Id from previously uploaded settings. You can also set manually in code settings (sync.gist). Press [Enter] or [Esc] to cancel.",
"common.prompt.enterGithubAccessToken": "You can manually add token also (User Folder / syncLocalSettings.json). Press [Enter] or [Esc] to cancel."
"common.prompt.enterGithubAccessToken": "You can manually add token also (User Folder / syncLocalSettings.json). Press [Enter] or [Esc] to cancel.",
"common.prompt.restartCode":"Do you want to reload to apply extensions and configurations ?"
}
3 changes: 1 addition & 2 deletions src/commons.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import { CustomSettings, ExtensionConfig, LocalConfig } from "./setting";
import { Util } from "./util";

export default class Commons {
public static outputChannel: vscode.OutputChannel = null;
public static LogException(
error: any,
message: string,
Expand Down Expand Up @@ -76,7 +77,6 @@ export default class Commons {

private static configWatcher = null;
private static extensionWatcher = null;
private static outputChannel: vscode.OutputChannel = null;

public ERROR_MESSAGE: string = localize("common.error.message");

Expand Down Expand Up @@ -639,7 +639,6 @@ export default class Commons {
}

const outputChannel = Commons.outputChannel;
outputChannel.clear();
outputChannel.appendLine(
`CODE SETTINGS SYNC ${upload ? "UPLOAD" : "DOWNLOAD"} SUMMARY`
);
Expand Down
3 changes: 0 additions & 3 deletions src/setting.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,6 @@ export class CustomSettings {
public lastDownload: Date = null;
public githubEnterpriseUrl: string = null;
public askGistName: boolean = false;

public customFiles: { [key: string]: string } = {};

public hostName: string = null;

}
45 changes: 21 additions & 24 deletions src/sync.ts
Original file line number Diff line number Diff line change
Expand Up @@ -525,28 +525,25 @@ export class Sync {
deletedExtensions = uncompletedExtensions;
}
}
let outputChannel: vscode.OutputChannel = null;
if (!syncSetting.quietSync) {
outputChannel = vscode.window.createOutputChannel(
"Code Settings Sync"
);
outputChannel.clear();
outputChannel.appendLine(
`CODE SETTINGS SYNC - COMMAND LINE EXTENSION DOWNLOAD SUMMARY`
);
outputChannel.appendLine(
`Version: ${Environment.getVersion()}`
);
outputChannel.appendLine(`--------------------`);
outputChannel.show();
}

try {
let useCli = true;
const autoUpdate: boolean = vscode.workspace
.getConfiguration("extensions")
.get("autoUpdate");
useCli = autoUpdate;
if (useCli) {
if (!syncSetting.quietSync) {
Commons.outputChannel = vscode.window.createOutputChannel(
"Code Settings Sync"
);
Commons.outputChannel.clear();
Commons.outputChannel.appendLine(
`COMMAND LINE EXTENSION DOWNLOAD SUMMARY`
);
Commons.outputChannel.appendLine(`--------------------`);
}
}

addedExtensions = await PluginService.InstallExtensions(
content,
Expand All @@ -557,7 +554,7 @@ export class Sync {
env.isInsiders,
(message: string, dispose: boolean) => {
if (!syncSetting.quietSync) {
outputChannel.appendLine(message);
Commons.outputChannel.appendLine(message);
} else {
console.log(message);
if (dispose) {
Expand All @@ -569,16 +566,8 @@ export class Sync {
}
}
);
if (!syncSetting.quietSync) {
outputChannel.clear();
outputChannel.dispose();
}
} catch (extensions) {
addedExtensions = extensions;
if (!syncSetting.quietSync) {
outputChannel.clear();
outputChannel.dispose();
}
}
}
} else {
Expand Down Expand Up @@ -647,6 +636,14 @@ export class Sync {
null,
localSettings
);
const message = await vscode.window.showInformationMessage(
localize("common.prompt.restartCode"),
"Yes"
);

if (message === "Yes") {
vscode.commands.executeCommand("workbench.action.reloadWindow");
}
vscode.window.setStatusBarMessage("").dispose();
} else {
vscode.window.setStatusBarMessage("").dispose();
Expand Down

0 comments on commit a2f096b

Please sign in to comment.