|
1 | 1 | import * as commonOptionsLibPath from "./common/options"; |
2 | | -import * as osenv from "osenv"; |
3 | | -import * as path from "path"; |
4 | 2 |
|
5 | 3 | export class Options extends commonOptionsLibPath.OptionsBase { |
6 | 4 | constructor($errors: IErrors, |
7 | 5 | $staticConfig: IStaticConfig, |
8 | | - $hostInfo: IHostInfo) { |
| 6 | + $hostInfo: IHostInfo, |
| 7 | + $settingsService: ISettingsService) { |
9 | 8 | super({ |
10 | 9 | ipa: { type: OptionType.String }, |
11 | 10 | frameworkPath: { type: OptionType.String }, |
@@ -39,24 +38,7 @@ export class Options extends commonOptionsLibPath.OptionsBase { |
39 | 38 | clean: { type: OptionType.Boolean }, |
40 | 39 | watch: { type: OptionType.Boolean, default: true } |
41 | 40 | }, |
42 | | - path.join($hostInfo.isWindows ? process.env.AppData : path.join(osenv.home(), ".local/share"), ".nativescript-cli"), |
43 | | - $errors, $staticConfig); |
44 | | - |
45 | | - // On Windows we moved settings from LocalAppData to AppData. Move the existing file to keep the existing settings |
46 | | - // I guess we can remove this code after some grace period, say after 1.7 is out |
47 | | - if ($hostInfo.isWindows) { |
48 | | - try { |
49 | | - const shelljs = require("shelljs"), |
50 | | - oldSettings = path.join(process.env.LocalAppData, ".nativescript-cli", "user-settings.json"), |
51 | | - newSettings = path.join(process.env.AppData, ".nativescript-cli", "user-settings.json"); |
52 | | - if (shelljs.test("-e", oldSettings) && !shelljs.test("-e", newSettings)) { |
53 | | - shelljs.mkdir(path.join(process.env.AppData, ".nativescript-cli")); |
54 | | - shelljs.mv(oldSettings, newSettings); |
55 | | - } |
56 | | - } catch (err) { |
57 | | - // ignore the error - it is too early to use $logger here |
58 | | - } |
59 | | - } |
| 41 | + $errors, $staticConfig, $settingsService); |
60 | 42 |
|
61 | 43 | const that = (<any>this); |
62 | 44 | // if justlaunch is set, it takes precedence over the --watch flag and the default true value |
|
0 commit comments