Skip to content

Commit f890576

Browse files
committed
Merge pull request #1413 from NativeScript/totev/roaming
Move settings into Roaming Windows profile
2 parents b31cb36 + fbb0f15 commit f890576

File tree

2 files changed

+17
-2
lines changed

2 files changed

+17
-2
lines changed

lib/options.ts

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,24 @@ export class Options extends commonOptionsLibPath.OptionsBase {
3636
copyTo: { type: OptionType.String },
3737
baseConfig: { type: OptionType.String }
3838
},
39-
path.join($hostInfo.isWindows ? process.env.LocalAppData : path.join(osenv.home(), ".local/share"), ".nativescript-cli"),
39+
path.join($hostInfo.isWindows ? process.env.AppData : path.join(osenv.home(), ".local/share"), ".nativescript-cli"),
4040
$errors, $staticConfig);
41+
42+
// On Windows we moved settings from LocalAppData to AppData. Move the existing file to keep the existing settings
43+
// I guess we can remove this code after some grace period, say after 1.7 is out
44+
if ($hostInfo.isWindows) {
45+
try {
46+
let shelljs = require("shelljs"),
47+
oldSettings = path.join(process.env.LocalAppData, ".nativescript-cli", "user-settings.json"),
48+
newSettings = path.join(process.env.AppData, ".nativescript-cli", "user-settings.json");
49+
if (shelljs.test("-e", oldSettings) && !shelljs.test("-e", newSettings)) {
50+
shelljs.mkdir(path.join(process.env.AppData, ".nativescript-cli"));
51+
shelljs.mv(oldSettings, newSettings);
52+
}
53+
} catch (err) {
54+
// ignore the error - it is too early to use $logger here
55+
}
56+
}
4157
}
4258
}
4359
$injector.register("options", Options);

lib/services/analytics-settings-service.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ class AnalyticsSettingsService implements IAnalyticsSettingsService {
1818
}
1919

2020
public getPrivacyPolicyLink(): string {
21-
// TODO: Replace with nativescript privacy-policy link, when such exists.
2221
return "http://www.telerik.com/company/privacy-policy";
2322
}
2423
}

0 commit comments

Comments
 (0)