Skip to content

Commit

Permalink
V2.9.1 (#539)
Browse files Browse the repository at this point in the history
* Fix for #516

* Resolves #510 - support OSS build of vscode

* add support for xdg environment paths

* readme: fixed typos

* v291

* Package updates
  • Loading branch information
shanalikhan authored May 1, 2018
1 parent 0c5b592 commit b18b9cb
Show file tree
Hide file tree
Showing 6 changed files with 43 additions and 38 deletions.
21 changes: 8 additions & 13 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,21 +1,16 @@
#### Version - 2.9.0
#### Version - 2.9.1

*Important* : Github is going to [disable anonymous Gist](https://blog.github.com/2018-02-18-deprecation-notice-removing-anonymous-gist-creation/) from March 19, 2018. Anonymous Gist support has been removed from Settings Sync.
* Bug Fix for OSS Variant [#510](https://github.com/shanalikhan/code-settings-sync/issues/510) - Thanks for PR [@JacobHenner](https://github.com/JacobHenner)
* Readme Typo Fix [#531](https://github.com/shanalikhan/code-settings-sync/issues/531) - Thanks for PR [@x4m3](https://github.com/x4m3)
* syncLocalSettings does not support replacing setting with "False" value [#516](https://github.com/shanalikhan/code-settings-sync/issues/516) - Thanks for PR [@leepowellcouk](https://github.com/leepowellcouk)

* Settings Sync now support OSS Variant [#77](https://github.com/shanalikhan/code-settings-sync/issues/77) - By @LC43
* Settings Sync now support "code-snippets" files and other snippets extensions [#340](https://github.com/shanalikhan/code-settings-sync/issues/340)
* Now you can configure settings sync not to delete extensions on download [#373](https://github.com/shanalikhan/code-settings-sync/issues/373)
* Now you can exclude extensions list while uploading [#389](https://github.com/shanalikhan/code-settings-sync/issues/389)
* If you are looking to use Settings Sync to download settings only. (e.g Fetch Team Environment) - Bug has been fixed [#487](https://github.com/shanalikhan/code-settings-sync/issues/487)




## Contributions
## [Contributions](https://github.com/shanalikhan/code-settings-sync/blob/master/CONTRIBUTING.md)

### Financial

I also welcome financial contributions in full transparency on our [open collective](https://opencollective.com/code-settings-sync).
[<img src="https://www.paypalobjects.com/en_US/i/btn/btn_donateCC_LG.gif">](https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=4W3EWHHBSYMM8&lc=IE&item_name=Code%20Settings%20Sync&item_number=visual%20studio%20code%20settings%20sync&currency_code=USD&bn=PP%2dDonationsBF%3abtn_donate_SM%2egif%3aNonHosted)

I also welcome financial contributions in case of special feature requests on my [open collective](https://opencollective.com/code-settings-sync).

### Community

Expand Down
11 changes: 8 additions & 3 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Join our public Slack:
<img src="https://shanalikhan.github.io/img/slack.PNG" alt="Drawing" style="width: 50px;"/>
</a>

If you need any help or want someone to set up the workspace with you and get you stepping through code in your IDE, make some noise in #contributors. Don't be afraid to speak up!
If you need any help or want someone to set up the workspace with you and get you stepping through code in your editor, make some noise in #contributors. Don't be afraid to speak up!

If you are looking forward to solve issues, you can select any issue you want but it would be great if you start with these issues, for these issues I will be specifically asking for help :

Expand All @@ -38,7 +38,13 @@ Git and Node should be enough to run this extension. Execute the commands above

## Financial contributions

I also welcome financial contributions in full transparency on our [open collective](https://opencollective.com/code-settings-sync).
You can contribute me financially by two ways:

1. Sending donation directly to my Paypal

[<img src="https://www.paypalobjects.com/en_US/i/btn/btn_donateCC_LG.gif">](https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=4W3EWHHBSYMM8&lc=IE&item_name=Code%20Settings%20Sync&item_number=visual%20studio%20code%20settings%20sync&currency_code=USD&bn=PP%2dDonationsBF%3abtn_donate_SM%2egif%3aNonHosted)

2. If you looking forward to add some special features for your company, for this I also welcome financial contributions in full transparency on my [open collective](https://opencollective.com/code-settings-sync).


## Credits
Expand All @@ -54,7 +60,6 @@ Thank you to all our backers! [[Become a backer](https://opencollective.com/code

<a href="https://opencollective.com/code-settings-sync#backers" target="_blank"><img src="https://opencollective.com/code-settings-sync/backers.svg?width=890"></a>


### Sponsors

Thank you to all our sponsors! (please ask your company to also support this open source project by [becoming a sponsor](https://opencollective.com/code-settings-sync/order/3849#))
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -133,31 +133,31 @@ Here is the gif of the complete process when you execute the Download command (M
Auto Download is **disabled by default**. It will sync all the setting by default when the editor starts.
Please make sure you have valid github Token and Gist available to make it work properly.

Select Command **"Sync : Advance Options > Toggle Auto-Download On Startup"** command to Turn ON / OFF the auto download.
Select Command **"Sync : Advanced Options > Toggle Auto-Download On Startup"** command to Turn ON / OFF the auto download.

## Toggle Force Download

Force Download is **disabled by default**. By default, extension won't download the latest settings if you already have the latest downloaded version, but sometimes when you delete some extension locally and don't upload the settings it will still show that you have latest versions by date or time checks, by turning this ON it will always download the cloud settings on startup.

Please make sure you have valid github Token and Gist available to make it work properly.

Select Command **"Sync : Advance Options > Toggle Force Download"** command to Turn ON / OFF the force download.
Select Command **"Sync : Advanced Options > Toggle Force Download"** command to Turn ON / OFF the force download.

## Toggle Auto-Upload on change

Auto-upload is **disabled by default**. When the settings are changed and saved this feature will automatically start the upload process and save the settings online.

Please make sure you have valid github Token and Gist available to make it work properly.

Select Command **"Sync : Advance Options > Toggle Auto-Upload on Setting Change"** command to Turn ON / OFF the auto-upload.
Select Command **"Sync : Advanced Options > Toggle Auto-Upload on Settings Change"** command to Turn ON / OFF the auto-upload.


## Toggle Summary

Summary is **enabled by default** which shows all files and extensions that are added or deleted on a single page.
You may turn it off in order to make a upload and download process clean and quiet.

Select Command **"Sync : Advance Options > Toggle Summary Page On Upload / Download"** command to Turn ON / OFF the auto download.
Select Command **"Sync : Advanced Options > Show Summary Page On Upload / Download"** command to Turn ON / OFF the auto download.

## Create Public Gist To Share Settings

Expand Down
18 changes: 9 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "code-settings-sync",
"displayName": "Settings Sync",
"description": "Synchronize Settings, Snippets, Themes, File Icons, Launch, Keybindings, Workspaces and Extensions Across Multiple Machines Using GitHub Gist.",
"version": "2.9.0",
"version": "2.9.1",
"icon": "images/cloud.png",
"publisher": "Shan",
"author": {
Expand Down Expand Up @@ -46,7 +46,7 @@
"email": "shanalikhan@hotmail.com"
},
"engines": {
"vscode": "^1.15.0"
"vscode": "^1.8.0"
},
"categories": [
"Other"
Expand Down Expand Up @@ -168,15 +168,15 @@
}
},
"scripts": {
"vscode:prepublish": "tsc -p ./",
"compile": "tsc -watch -p ./",
"postinstall": "node ./node_modules/vscode/bin/install",
"test": "node ./node_modules/vscode/bin/test"
"vscode:prepublish": "npm run compile",
"compile": "tsc -p ./",
"watch": "tsc -watch -p ./",
"postinstall": "node ./node_modules/vscode/bin/install"
},
"devDependencies": {
"typescript": "^2.2.2",
"vscode": "^1.1.0",
"@types/node": "^9.4.1"
"typescript": "^2.8.3",
"vscode": "^1.1.6",
"@types/node": "^10.0.0"
},
"dependencies": {
"adm-zip": "^0.4.7",
Expand Down
20 changes: 13 additions & 7 deletions src/environmentPath.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,15 @@ import * as fs from 'fs';

export class Environment {

public static CURRENT_VERSION: number = 290;
public static CURRENT_VERSION: number = 291;
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;
}

private context: vscode.ExtensionContext;
public isInsiders = null;
public isOss = null;
public homeDir = null;
public USER_FOLDER = null;

Expand Down Expand Up @@ -49,11 +50,17 @@ export class Environment {
public APP_SUMMARY: string = null;

constructor(context: vscode.ExtensionContext) {
var os = require("os");
this.context = context;
this.isInsiders = /insiders/.test(context.asAbsolutePath(""));
this.homeDir = process.env[(process.platform == 'win32') ? 'USERPROFILE' : 'HOME'];
this.ExtensionFolder = path.join(this.homeDir, this.isInsiders ? '.vscode-insiders' : '.vscode', 'extensions');
var os = require("os");
this.isOss = /oss/.test(context.asAbsolutePath(""));
const isXdg = !this.isInsiders && !!this.isOss && process.platform === 'linux' && !!process.env.XDG_DATA_HOME
this.homeDir = isXdg
? process.env.XDG_DATA_HOME
: process.env[(process.platform == 'win32') ? 'USERPROFILE' : 'HOME'];
const configSuffix = `${isXdg ? '' : '.'}vscode${this.isInsiders ? '-insiders' : this.isOss ? '-oss' : ''}`
this.ExtensionFolder = path.join(this.homeDir, configSuffix, 'extensions');

//console.log(os.type());

process.env.NODE_TLS_REJECT_UNAUTHORIZED = "0"
Expand All @@ -66,8 +73,7 @@ export class Environment {
this.OsType = OsType.Mac;
}
else if (process.platform == 'linux') {
var os = require("os");
this.PATH = os.homedir() + '/.config';
this.PATH = isXdg && !!process.env.XDG_CONFIG_HOME ? process.env.XDG_CONFIG_HOME : os.homedir() + '/.config';
this.OsType = OsType.Linux;
} else {
this.PATH = '/var/local';
Expand All @@ -84,7 +90,7 @@ export class Environment {
});
}

const possibleCodePaths = [this.isInsiders ? '/Code - Insiders' : '/Code', '/Code - OSS'];
const possibleCodePaths = [this.isInsiders ? '/Code - Insiders' : this.isOss ? '/Code - OSS' : '/Code'];
for (const _path of possibleCodePaths) {
try {
fs.statSync(this.PATH + _path);
Expand Down
3 changes: 1 addition & 2 deletions src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -451,9 +451,8 @@ export async function activate(context: vscode.ExtensionContext) {
let config = vscode.workspace.getConfiguration();
let keysDefined: Array<string> = Object.keys(customSettings.replaceCodeSettings);
keysDefined.forEach((key: string, index: number) => {
let c: string = undefined;
let value: string = customSettings.replaceCodeSettings[key];
value == "" ? c == undefined : c = value;
let c: any = value === "" ? undefined : value;
config.update(key, c, true);
});
}
Expand Down

0 comments on commit b18b9cb

Please sign in to comment.