From cfc004ff98ebfa8237f86829fc3f756e6a4a9aec Mon Sep 17 00:00:00 2001 From: Shan Khan Date: Tue, 31 Jan 2017 16:02:11 +0500 Subject: [PATCH] Release for #190 and #194 --- package.json | 2 +- src/commons.ts | 18 +++++++++++++----- src/environmentPath.ts | 2 +- 3 files changed, 15 insertions(+), 7 deletions(-) diff --git a/package.json b/package.json index b89aa794..5c628d14 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "code-settings-sync", "displayName": "Settings Sync", "description": "Synchronize Settings, Snippets, launch, keybindings, workspaces and extensions Across Multiple Machines using Github Gist.", - "version": "2.4.2", + "version": "2.4.3", "icon": "images/cloud.png", "publisher": "Shan", "author": { diff --git a/src/commons.ts b/src/commons.ts index 0a2417a3..ba62d93d 100644 --- a/src/commons.ts +++ b/src/commons.ts @@ -29,6 +29,9 @@ export class Commons { message = "Sync : Internet Not Connected or Unable to Connect to Github. Exception Logged in Console"; msgBox = false; } + if (error.code == 4) { + message = "Sync : Unable to Save Settings. Please make sure you have valid JSON settings.json file. ( e.g : No trailing commas )"; + } } vscode.window.setStatusBarMessage(""); @@ -243,12 +246,17 @@ export class Commons { else { let settings: ExtensionConfig = await me.GetSettings(); if (settings.version == 0 || settings.version < Environment.CURRENT_VERSION) { - if (settings.version == 0) { - vscode.window.showInformationMessage("Sync : Settings Created"); - } + let oldSettingVersion: number = settings.version; settings.version = Environment.CURRENT_VERSION; - await me.SaveSettings(settings); - vscode.window.setStatusBarMessage("Sync : Settings Version Updated to v" + Environment.getVersion(), 2000); + let done: boolean = await me.SaveSettings(settings); + if (done == true) { + if (oldSettingVersion == 0) { + vscode.window.showInformationMessage("Sync : Settings Created"); + } + else { + vscode.window.setStatusBarMessage("Sync : Settings Version Updated to v" + Environment.getVersion(), 2000); + } + } } } resolve(true); diff --git a/src/environmentPath.ts b/src/environmentPath.ts index 9eebc6ae..5426910c 100644 --- a/src/environmentPath.ts +++ b/src/environmentPath.ts @@ -5,7 +5,7 @@ import { OsType } from './enums'; export class Environment { - public static CURRENT_VERSION: number = 242; + public static CURRENT_VERSION: number = 243; public static getVersion(): string { var txt2 = Environment.CURRENT_VERSION.toString().slice(0, 1) + "." + Environment.CURRENT_VERSION.toString().slice(1,2)+ "." + Environment.CURRENT_VERSION.toString().slice(2,3); return txt2;