Skip to content

Commit

Permalink
Merge pull request #681 from shanalikhan/improvement
Browse files Browse the repository at this point in the history
Gist Object changed
  • Loading branch information
shanalikhan authored Oct 16, 2018
2 parents 29839a9 + 8caf184 commit f4900a2
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 18 deletions.
4 changes: 4 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,11 @@
"activationEvents": [
"*"
],
<<<<<<< HEAD
"main": "./out/extension",
=======
"main": "./out/src/extension",
>>>>>>> v3.2
"contributes": {
"commands": [
{
Expand Down
32 changes: 19 additions & 13 deletions src/environmentPath.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@ export class Environment {

public isInsiders: boolean = false;
public isOss: boolean = false;
public isPortable : boolean = false;
public isPortable: boolean = false;
public homeDir: string | null = null;
public USER_FOLDER : string = null;
public USER_FOLDER: string = null;

public ExtensionFolder: string = null;
public PATH: string = null;
Expand Down Expand Up @@ -77,7 +77,7 @@ export class Environment {
const configSuffix = `${isXdg ? "" : "."}vscode${
this.isInsiders ? "-insiders" : this.isOss ? "-oss" : ""
}`;

process.env.NODE_TLS_REJECT_UNAUTHORIZED = "0";
this.PATH = process.env.APPDATA;
this.OsType = OsType.Windows;
Expand Down Expand Up @@ -107,7 +107,7 @@ export class Environment {
this.OsType = OsType.Linux;
} else {
this.PATH = process.env.VSCODE_PORTABLE;
this.OsType = OsType.Linux;
this.OsType = OsType.Windows;
}
}

Expand All @@ -122,7 +122,7 @@ export class Environment {
// command output is in stdout
});
}
if(!this.isPortable){
if (!this.isPortable) {
const possibleCodePaths = [];
if (this.isInsiders) {
possibleCodePaths.push("/Code - Insiders");
Expand All @@ -142,23 +142,29 @@ export class Environment {
console.error(e);
}
}
this.ExtensionFolder = path.join(this.homeDir, configSuffix, "extensions");
this.ExtensionFolder = path.join(
this.homeDir,
configSuffix,
"extensions"
);
this.USER_FOLDER = this.PATH.concat("/User/");

}
else{
} else {
this.USER_FOLDER = this.PATH.concat("/user-data/User/");
this.ExtensionFolder = this.PATH.concat("/extensions/")
this.ExtensionFolder = this.PATH.concat("/extensions/");
}

this.FILE_EXTENSION = this.USER_FOLDER.concat(this.FILE_EXTENSION_NAME);
this.FILE_SETTING = this.USER_FOLDER.concat(this.FILE_SETTING_NAME);
this.FILE_LAUNCH = this.USER_FOLDER.concat(this.FILE_LAUNCH_NAME);
this.FILE_KEYBINDING = this.USER_FOLDER.concat(this.FILE_KEYBINDING_NAME);
this.FILE_LOCALE = this.USER_FOLDER.concat(this.FILE_LOCALE_NAME);
this.FOLDER_SNIPPETS = this.USER_FOLDER.concat("/snippets/");
this.FILE_CLOUDSETTINGS = this.USER_FOLDER.concat(this.FILE_CLOUDSETTINGS_NAME);
this.FILE_CUSTOMIZEDSETTINGS = this.USER_FOLDER.concat(this.FILE_CUSTOMIZEDSETTINGS_NAME);
this.FILE_CLOUDSETTINGS = this.USER_FOLDER.concat(
this.FILE_CLOUDSETTINGS_NAME
);
this.FILE_CUSTOMIZEDSETTINGS = this.USER_FOLDER.concat(
this.FILE_CUSTOMIZEDSETTINGS_NAME
);
this.FILE_SYNC_LOCK = this.USER_FOLDER.concat(this.FILE_SYNC_LOCK_NAME);
}
}
2 changes: 1 addition & 1 deletion src/service/githubService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export class GitHubService {
public userName: string = null;
public name: string = null;
private github: GitHubApi = null;
private GIST_JSON_EMPTY: GitHubApi.GistsCreateParams = {
private GIST_JSON_EMPTY: any = {
description: "Visual Studio Code Sync Settings Gist",
public: false,
files: {
Expand Down
5 changes: 1 addition & 4 deletions src/sync.ts
Original file line number Diff line number Diff line change
Expand Up @@ -208,10 +208,7 @@ export class Sync {
}

for (const snippetFile of contentFiles) {
if (
snippetFile.fileName !== env.APP_SUMMARY_NAME &&
snippetFile.fileName !== env.FILE_KEYBINDING_MAC
) {
if (snippetFile.fileName !== env.FILE_KEYBINDING_MAC) {
if (snippetFile.content !== "") {
if (snippetFile.fileName === env.FILE_KEYBINDING_NAME) {
snippetFile.gistName =
Expand Down

0 comments on commit f4900a2

Please sign in to comment.