@aneuhold/core-ts-lib 1.0.8 → 1.0.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (55) hide show
  1. package/lib/helperFunctions/dateFunctions.d.ts +9 -9
  2. package/lib/helperFunctions/dateFunctions.js +15 -15
  3. package/lib/helperFunctions/sleep.d.ts +6 -6
  4. package/lib/helperFunctions/sleep.js +12 -12
  5. package/lib/helperFunctions/stringFunctions.d.ts +8 -8
  6. package/lib/helperFunctions/stringFunctions.js +13 -13
  7. package/lib/index.d.ts +12 -11
  8. package/lib/index.d.ts.map +1 -1
  9. package/lib/index.js +54 -52
  10. package/lib/services/CLIService.d.ts +68 -68
  11. package/lib/services/CLIService.js +194 -194
  12. package/lib/services/StringService.d.ts +13 -13
  13. package/lib/services/StringService.js +18 -18
  14. package/lib/services/applications/ChromeService.d.ts +19 -19
  15. package/lib/services/applications/ChromeService.js +60 -60
  16. package/lib/services/applications/DockerService.d.ts +20 -20
  17. package/lib/services/applications/DockerService.js +88 -88
  18. package/lib/services/applications/FileSystemService.d.ts +17 -17
  19. package/lib/services/applications/FileSystemService.js +87 -87
  20. package/lib/services/applications/ITermService.d.ts +8 -0
  21. package/lib/services/applications/ITermService.d.ts.map +1 -0
  22. package/lib/services/applications/ITermService.js +45 -0
  23. package/lib/services/applications/OsaScriptService.d.ts +4 -0
  24. package/lib/services/applications/OsaScriptService.d.ts.map +1 -0
  25. package/lib/services/applications/OsaScriptService.js +31 -0
  26. package/lib/utils/CurrentEnv.d.ts +62 -61
  27. package/lib/utils/CurrentEnv.d.ts.map +1 -1
  28. package/lib/utils/CurrentEnv.js +137 -133
  29. package/lib/utils/Logger.d.ts +67 -67
  30. package/lib/utils/Logger.js +112 -112
  31. package/lib/utils/OsaScriptBuilder.d.ts +45 -0
  32. package/lib/utils/OsaScriptBuilder.d.ts.map +1 -0
  33. package/lib/utils/OsaScriptBuilder.js +53 -0
  34. package/package.json +1 -1
  35. package/lib/helperFunctions/applications/applications.d.ts +0 -21
  36. package/lib/helperFunctions/applications/applications.d.ts.map +0 -1
  37. package/lib/helperFunctions/applications/applications.js +0 -26
  38. package/lib/helperFunctions/applications/chromeApplication.d.ts +0 -8
  39. package/lib/helperFunctions/applications/chromeApplication.d.ts.map +0 -1
  40. package/lib/helperFunctions/applications/chromeApplication.js +0 -63
  41. package/lib/helperFunctions/applications/fileSystemApplication.d.ts +0 -8
  42. package/lib/helperFunctions/applications/fileSystemApplication.d.ts.map +0 -1
  43. package/lib/helperFunctions/applications/fileSystemApplication.js +0 -51
  44. package/lib/helperFunctions/cmd.d.ts +0 -54
  45. package/lib/helperFunctions/cmd.d.ts.map +0 -1
  46. package/lib/helperFunctions/cmd.js +0 -177
  47. package/lib/helperFunctions/fileFunctions.d.ts +0 -10
  48. package/lib/helperFunctions/fileFunctions.d.ts.map +0 -1
  49. package/lib/helperFunctions/fileFunctions.js +0 -43
  50. package/lib/helperFunctions/input.d.ts +0 -8
  51. package/lib/helperFunctions/input.d.ts.map +0 -1
  52. package/lib/helperFunctions/input.js +0 -48
  53. package/lib/utils/Log.d.ts +0 -69
  54. package/lib/utils/Log.d.ts.map +0 -1
  55. package/lib/utils/Log.js +0 -112
@@ -1,194 +1,194 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
- Object.defineProperty(o, "default", { enumerable: true, value: v });
15
- }) : function(o, v) {
16
- o["default"] = v;
17
- });
18
- var __importStar = (this && this.__importStar) || function (mod) {
19
- if (mod && mod.__esModule) return mod;
20
- var result = {};
21
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
- __setModuleDefault(result, mod);
23
- return result;
24
- };
25
- var __importDefault = (this && this.__importDefault) || function (mod) {
26
- return (mod && mod.__esModule) ? mod : { "default": mod };
27
- };
28
- Object.defineProperty(exports, "__esModule", { value: true });
29
- const child_process_1 = require("child_process");
30
- const rl = __importStar(require("readline"));
31
- const util_1 = __importDefault(require("util"));
32
- const sleep_1 = __importDefault(require("../helperFunctions/sleep"));
33
- const CurrentEnv_1 = __importStar(require("../utils/CurrentEnv"));
34
- const Logger_1 = __importDefault(require("../utils/Logger"));
35
- /**
36
- * The promisified version of the {@link normalExec} function.
37
- */
38
- const execute = util_1.default.promisify(child_process_1.exec);
39
- /**
40
- * A service which can be used to interact with the command line on the current
41
- * system.
42
- */
43
- class CLIService {
44
- static POWERSHELL_PREFIX = `pwsh -NoProfile -Command `;
45
- /**
46
- * Executes the given command in a shell environment. Spins up a separate
47
- * process to execute the command and returns a promise once it is completely
48
- * finished.
49
- *
50
- * The shell environment chosen is determined by the `CurrentEnv` class.
51
- *
52
- * @param cmd the command to run. This is ran as a normal execution where the
53
- * output is all returned at once after completion. For example this could be
54
- * `ls -a`.
55
- *
56
- * @param logError if set to false, it will not output a log if an error
57
- * occurs in `stderr` when executing the function. This can be useful if
58
- * a command regularly outputs an error even when it succeeds. This only
59
- * applies to commands ran with normal execution.
60
- *
61
- * @param cwd the current working directory to run the command in. If not
62
- * provided, it will use the current working directory of the process.
63
- *
64
- * @param useProfile if set to true will use the current profile or zshrc of
65
- * the shell environment. By default this is false.
66
- *
67
- * @returns an object that holds the output and true if the command completed
68
- * successfully or false if it did not.
69
- */
70
- static async execCmd(cmd, logError = false, cwd, useProfile = false) {
71
- const execOptions = {};
72
- if (cwd) {
73
- execOptions.cwd = cwd;
74
- }
75
- let commandToExecute = cmd;
76
- // Set the powershell prefix if the current OS is Windows so that
77
- // the profile is not ran before the command.
78
- if (CurrentEnv_1.default.os === CurrentEnv_1.OperatingSystemType.Windows && !useProfile) {
79
- commandToExecute = `${CLIService.POWERSHELL_PREFIX}${cmd}`;
80
- }
81
- else if (CurrentEnv_1.default.os === CurrentEnv_1.OperatingSystemType.Windows && useProfile) {
82
- execOptions.shell = 'pwsh';
83
- }
84
- Logger_1.default.verbose.info(`Executing command: ${commandToExecute}`);
85
- try {
86
- const { stdout, stderr } = await execute(commandToExecute, execOptions);
87
- if (stderr) {
88
- if (logError) {
89
- Logger_1.default.error(`There was an error executing ${cmd}. Details are printed below:
90
- ${stderr}`);
91
- }
92
- return {
93
- didComplete: false,
94
- output: stderr
95
- };
96
- }
97
- Logger_1.default.verbose.info(`Output from stdout is: ${stdout}`);
98
- return {
99
- didComplete: true,
100
- output: stdout
101
- };
102
- }
103
- catch (err) {
104
- Logger_1.default.verbose
105
- .error(`There was an error executing the "exec" function. Details are printed below:
106
- ${err}`);
107
- return {
108
- didComplete: false,
109
- output: err
110
- };
111
- }
112
- }
113
- /**
114
- * Executes the given command but fulfills the
115
- * promise when either the command completes, or the given number of ms have
116
- * passed. Whichever comes first.
117
- *
118
- * @param command the command to execute
119
- * @param ms the number of milliseconds to wait. This is 5 seconds by default.
120
- */
121
- static async execCmdWithTimeout(command, ms = 5000) {
122
- const sleepPromise = (0, sleep_1.default)(ms).then(() => {
123
- return {
124
- didComplete: false,
125
- output: `Command ended after ${ms} ms.`
126
- };
127
- });
128
- return Promise.any([sleepPromise, CLIService.execCmd(command)]);
129
- }
130
- /**
131
- * Spawns a new process where the command is ran as a stream where all
132
- * output is streamed to the console.
133
- * This is helpful for long-running commands or commands
134
- * that output a lot of data. For example `yarn` or `npm install`.
135
- * All of the output from this is logged by default because of the listeners
136
- * involved. This could be changed in the future though.
137
- *
138
- * @param cmd the command to run. This is the the first argument passed to the
139
- * `spawn` function. For example this could be `npm`.
140
- * @param args the arguments to pass to the command. For example this could be
141
- * `['install', 'react']`.
142
- */
143
- static async spawnCmd(cmd, args, currentWorkingDirectory) {
144
- return new Promise((resolve) => {
145
- let output = '';
146
- const execOptions = {
147
- cwd: currentWorkingDirectory
148
- };
149
- const spawnedCmd = (0, child_process_1.spawn)(cmd, args, execOptions);
150
- spawnedCmd.on('error', (err) => {
151
- Logger_1.default.error(`There was an error executing the "spawn" function. Details are printed below:
152
- ${err}`);
153
- resolve({
154
- didComplete: false,
155
- output: err.toString()
156
- });
157
- });
158
- spawnedCmd.stdout.on('data', (data) => {
159
- output += data;
160
- Logger_1.default.info(data, true);
161
- });
162
- spawnedCmd.stderr.on('data', (data) => {
163
- output += data;
164
- Logger_1.default.info(data, true);
165
- });
166
- spawnedCmd.on('close', (exitCode) => {
167
- Logger_1.default.info(`Command "${cmd}" exited with code ${exitCode}`);
168
- resolve({
169
- didComplete: true,
170
- output
171
- });
172
- });
173
- });
174
- }
175
- /**
176
- * Gets input from the user on command line.
177
- *
178
- * @param promptToUser the prompt that should be provided to the user. Include
179
- * a newline at the end if you want there to be one.
180
- */
181
- static async getUserInput(promptToUser) {
182
- const readline = rl.createInterface({
183
- input: process.stdin,
184
- output: process.stdout
185
- });
186
- return new Promise((resolve) => {
187
- readline.question(promptToUser, (input) => {
188
- readline.close();
189
- resolve(input);
190
- });
191
- });
192
- }
193
- }
194
- exports.default = CLIService;
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || function (mod) {
19
+ if (mod && mod.__esModule) return mod;
20
+ var result = {};
21
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
+ __setModuleDefault(result, mod);
23
+ return result;
24
+ };
25
+ var __importDefault = (this && this.__importDefault) || function (mod) {
26
+ return (mod && mod.__esModule) ? mod : { "default": mod };
27
+ };
28
+ Object.defineProperty(exports, "__esModule", { value: true });
29
+ const child_process_1 = require("child_process");
30
+ const rl = __importStar(require("readline"));
31
+ const util_1 = __importDefault(require("util"));
32
+ const sleep_1 = __importDefault(require("../helperFunctions/sleep"));
33
+ const CurrentEnv_1 = __importStar(require("../utils/CurrentEnv"));
34
+ const Logger_1 = __importDefault(require("../utils/Logger"));
35
+ /**
36
+ * The promisified version of the {@link normalExec} function.
37
+ */
38
+ const execute = util_1.default.promisify(child_process_1.exec);
39
+ /**
40
+ * A service which can be used to interact with the command line on the current
41
+ * system.
42
+ */
43
+ class CLIService {
44
+ static POWERSHELL_PREFIX = `pwsh -NoProfile -Command `;
45
+ /**
46
+ * Executes the given command in a shell environment. Spins up a separate
47
+ * process to execute the command and returns a promise once it is completely
48
+ * finished.
49
+ *
50
+ * The shell environment chosen is determined by the `CurrentEnv` class.
51
+ *
52
+ * @param cmd the command to run. This is ran as a normal execution where the
53
+ * output is all returned at once after completion. For example this could be
54
+ * `ls -a`.
55
+ *
56
+ * @param logError if set to false, it will not output a log if an error
57
+ * occurs in `stderr` when executing the function. This can be useful if
58
+ * a command regularly outputs an error even when it succeeds. This only
59
+ * applies to commands ran with normal execution.
60
+ *
61
+ * @param cwd the current working directory to run the command in. If not
62
+ * provided, it will use the current working directory of the process.
63
+ *
64
+ * @param useProfile if set to true will use the current profile or zshrc of
65
+ * the shell environment. By default this is false.
66
+ *
67
+ * @returns an object that holds the output and true if the command completed
68
+ * successfully or false if it did not.
69
+ */
70
+ static async execCmd(cmd, logError = false, cwd, useProfile = false) {
71
+ const execOptions = {};
72
+ if (cwd) {
73
+ execOptions.cwd = cwd;
74
+ }
75
+ let commandToExecute = cmd;
76
+ // Set the powershell prefix if the current OS is Windows so that
77
+ // the profile is not ran before the command.
78
+ if (CurrentEnv_1.default.os === CurrentEnv_1.OperatingSystemType.Windows && !useProfile) {
79
+ commandToExecute = `${CLIService.POWERSHELL_PREFIX}${cmd}`;
80
+ }
81
+ else if (CurrentEnv_1.default.os === CurrentEnv_1.OperatingSystemType.Windows && useProfile) {
82
+ execOptions.shell = 'pwsh';
83
+ }
84
+ Logger_1.default.verbose.info(`Executing command: ${commandToExecute}`);
85
+ try {
86
+ const { stdout, stderr } = await execute(commandToExecute, execOptions);
87
+ if (stderr) {
88
+ if (logError) {
89
+ Logger_1.default.error(`There was an error executing ${cmd}. Details are printed below:
90
+ ${stderr}`);
91
+ }
92
+ return {
93
+ didComplete: false,
94
+ output: stderr
95
+ };
96
+ }
97
+ Logger_1.default.verbose.info(`Output from stdout is: ${stdout}`);
98
+ return {
99
+ didComplete: true,
100
+ output: stdout
101
+ };
102
+ }
103
+ catch (err) {
104
+ Logger_1.default.verbose
105
+ .error(`There was an error executing the "exec" function. Details are printed below:
106
+ ${err}`);
107
+ return {
108
+ didComplete: false,
109
+ output: err
110
+ };
111
+ }
112
+ }
113
+ /**
114
+ * Executes the given command but fulfills the
115
+ * promise when either the command completes, or the given number of ms have
116
+ * passed. Whichever comes first.
117
+ *
118
+ * @param command the command to execute
119
+ * @param ms the number of milliseconds to wait. This is 5 seconds by default.
120
+ */
121
+ static async execCmdWithTimeout(command, ms = 5000) {
122
+ const sleepPromise = (0, sleep_1.default)(ms).then(() => {
123
+ return {
124
+ didComplete: false,
125
+ output: `Command ended after ${ms} ms.`
126
+ };
127
+ });
128
+ return Promise.any([sleepPromise, CLIService.execCmd(command)]);
129
+ }
130
+ /**
131
+ * Spawns a new process where the command is ran as a stream where all
132
+ * output is streamed to the console.
133
+ * This is helpful for long-running commands or commands
134
+ * that output a lot of data. For example `yarn` or `npm install`.
135
+ * All of the output from this is logged by default because of the listeners
136
+ * involved. This could be changed in the future though.
137
+ *
138
+ * @param cmd the command to run. This is the the first argument passed to the
139
+ * `spawn` function. For example this could be `npm`.
140
+ * @param args the arguments to pass to the command. For example this could be
141
+ * `['install', 'react']`.
142
+ */
143
+ static async spawnCmd(cmd, args, currentWorkingDirectory) {
144
+ return new Promise((resolve) => {
145
+ let output = '';
146
+ const execOptions = {
147
+ cwd: currentWorkingDirectory
148
+ };
149
+ const spawnedCmd = (0, child_process_1.spawn)(cmd, args, execOptions);
150
+ spawnedCmd.on('error', (err) => {
151
+ Logger_1.default.error(`There was an error executing the "spawn" function. Details are printed below:
152
+ ${err}`);
153
+ resolve({
154
+ didComplete: false,
155
+ output: err.toString()
156
+ });
157
+ });
158
+ spawnedCmd.stdout.on('data', (data) => {
159
+ output += data;
160
+ Logger_1.default.info(data, true);
161
+ });
162
+ spawnedCmd.stderr.on('data', (data) => {
163
+ output += data;
164
+ Logger_1.default.info(data, true);
165
+ });
166
+ spawnedCmd.on('close', (exitCode) => {
167
+ Logger_1.default.info(`Command "${cmd}" exited with code ${exitCode}`);
168
+ resolve({
169
+ didComplete: true,
170
+ output
171
+ });
172
+ });
173
+ });
174
+ }
175
+ /**
176
+ * Gets input from the user on command line.
177
+ *
178
+ * @param promptToUser the prompt that should be provided to the user. Include
179
+ * a newline at the end if you want there to be one.
180
+ */
181
+ static async getUserInput(promptToUser) {
182
+ const readline = rl.createInterface({
183
+ input: process.stdin,
184
+ output: process.stdout
185
+ });
186
+ return new Promise((resolve) => {
187
+ readline.question(promptToUser, (input) => {
188
+ readline.close();
189
+ resolve(input);
190
+ });
191
+ });
192
+ }
193
+ }
194
+ exports.default = CLIService;
@@ -1,14 +1,14 @@
1
- /**
2
- * A service which can be used to interact with strings.
3
- */
4
- export default class StringService {
5
- /**
6
- * Gets the file extension of the provided file name.
7
- *
8
- * @param fileName the full name of the file or the entire file path
9
- * @returns a string containing the extension of the file name or undefined
10
- * if there is no extension
11
- */
12
- static getFileNameExtension(fileName: string): string | undefined;
13
- }
1
+ /**
2
+ * A service which can be used to interact with strings.
3
+ */
4
+ export default class StringService {
5
+ /**
6
+ * Gets the file extension of the provided file name.
7
+ *
8
+ * @param fileName the full name of the file or the entire file path
9
+ * @returns a string containing the extension of the file name or undefined
10
+ * if there is no extension
11
+ */
12
+ static getFileNameExtension(fileName: string): string | undefined;
13
+ }
14
14
  //# sourceMappingURL=StringService.d.ts.map
@@ -1,18 +1,18 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- /**
4
- * A service which can be used to interact with strings.
5
- */
6
- class StringService {
7
- /**
8
- * Gets the file extension of the provided file name.
9
- *
10
- * @param fileName the full name of the file or the entire file path
11
- * @returns a string containing the extension of the file name or undefined
12
- * if there is no extension
13
- */
14
- static getFileNameExtension(fileName) {
15
- return fileName.split('.').pop();
16
- }
17
- }
18
- exports.default = StringService;
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ /**
4
+ * A service which can be used to interact with strings.
5
+ */
6
+ class StringService {
7
+ /**
8
+ * Gets the file extension of the provided file name.
9
+ *
10
+ * @param fileName the full name of the file or the entire file path
11
+ * @returns a string containing the extension of the file name or undefined
12
+ * if there is no extension
13
+ */
14
+ static getFileNameExtension(fileName) {
15
+ return fileName.split('.').pop();
16
+ }
17
+ }
18
+ exports.default = StringService;
@@ -1,20 +1,20 @@
1
- import { OperatingSystemType } from '../../utils/CurrentEnv';
2
- /**
3
- * A service that provides functionality for interacting with the Chrome
4
- * browser.
5
- */
6
- export default class ChromeService {
7
- /**
8
- * Gets the path to the chrome application for the current system given the
9
- * operating system type.
10
- *
11
- * This does include the quotes
12
- */
13
- static getChromePath(os: OperatingSystemType): string | null;
14
- /**
15
- * Opens and sets pinned tabs in chrome. Still trying to figure out
16
- * how to get this to work.
17
- */
18
- static openAndSetPinnedTabs(): Promise<void>;
19
- }
1
+ import { OperatingSystemType } from '../../utils/CurrentEnv';
2
+ /**
3
+ * A service that provides functionality for interacting with the Chrome
4
+ * browser.
5
+ */
6
+ export default class ChromeService {
7
+ /**
8
+ * Gets the path to the chrome application for the current system given the
9
+ * operating system type.
10
+ *
11
+ * This does include the quotes
12
+ */
13
+ static getChromePath(os: OperatingSystemType): string | null;
14
+ /**
15
+ * Opens and sets pinned tabs in chrome. Still trying to figure out
16
+ * how to get this to work.
17
+ */
18
+ static openAndSetPinnedTabs(): Promise<void>;
19
+ }
20
20
  //# sourceMappingURL=ChromeService.d.ts.map
@@ -1,60 +1,60 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
- Object.defineProperty(o, "default", { enumerable: true, value: v });
15
- }) : function(o, v) {
16
- o["default"] = v;
17
- });
18
- var __importStar = (this && this.__importStar) || function (mod) {
19
- if (mod && mod.__esModule) return mod;
20
- var result = {};
21
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
- __setModuleDefault(result, mod);
23
- return result;
24
- };
25
- var __importDefault = (this && this.__importDefault) || function (mod) {
26
- return (mod && mod.__esModule) ? mod : { "default": mod };
27
- };
28
- Object.defineProperty(exports, "__esModule", { value: true });
29
- const CurrentEnv_1 = __importStar(require("../../utils/CurrentEnv"));
30
- const CLIService_1 = __importDefault(require("../CLIService"));
31
- /**
32
- * A service that provides functionality for interacting with the Chrome
33
- * browser.
34
- */
35
- class ChromeService {
36
- /**
37
- * Gets the path to the chrome application for the current system given the
38
- * operating system type.
39
- *
40
- * This does include the quotes
41
- */
42
- static getChromePath(os) {
43
- switch (os) {
44
- case CurrentEnv_1.OperatingSystemType.MacOSX:
45
- return `"/Applications/Google Chrome.app/Contents/MacOS/Google Chrome"`;
46
- case CurrentEnv_1.OperatingSystemType.Windows:
47
- return `& "C:\\Program Files (x86)\\Google\\Chrome\\Application\\chrome.exe"`;
48
- default:
49
- return null;
50
- }
51
- }
52
- /**
53
- * Opens and sets pinned tabs in chrome. Still trying to figure out
54
- * how to get this to work.
55
- */
56
- static async openAndSetPinnedTabs() {
57
- await CLIService_1.default.execCmd(`${ChromeService.getChromePath(CurrentEnv_1.default.os)} --pinned-tab-count=2 https://google.com https://tonyneuhold.com`);
58
- }
59
- }
60
- exports.default = ChromeService;
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || function (mod) {
19
+ if (mod && mod.__esModule) return mod;
20
+ var result = {};
21
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
+ __setModuleDefault(result, mod);
23
+ return result;
24
+ };
25
+ var __importDefault = (this && this.__importDefault) || function (mod) {
26
+ return (mod && mod.__esModule) ? mod : { "default": mod };
27
+ };
28
+ Object.defineProperty(exports, "__esModule", { value: true });
29
+ const CurrentEnv_1 = __importStar(require("../../utils/CurrentEnv"));
30
+ const CLIService_1 = __importDefault(require("../CLIService"));
31
+ /**
32
+ * A service that provides functionality for interacting with the Chrome
33
+ * browser.
34
+ */
35
+ class ChromeService {
36
+ /**
37
+ * Gets the path to the chrome application for the current system given the
38
+ * operating system type.
39
+ *
40
+ * This does include the quotes
41
+ */
42
+ static getChromePath(os) {
43
+ switch (os) {
44
+ case CurrentEnv_1.OperatingSystemType.MacOSX:
45
+ return `"/Applications/Google Chrome.app/Contents/MacOS/Google Chrome"`;
46
+ case CurrentEnv_1.OperatingSystemType.Windows:
47
+ return `& "C:\\Program Files (x86)\\Google\\Chrome\\Application\\chrome.exe"`;
48
+ default:
49
+ return null;
50
+ }
51
+ }
52
+ /**
53
+ * Opens and sets pinned tabs in chrome. Still trying to figure out
54
+ * how to get this to work.
55
+ */
56
+ static async openAndSetPinnedTabs() {
57
+ await CLIService_1.default.execCmd(`${ChromeService.getChromePath(CurrentEnv_1.default.os)} --pinned-tab-count=2 https://google.com https://tonyneuhold.com`);
58
+ }
59
+ }
60
+ exports.default = ChromeService;
@@ -1,21 +1,21 @@
1
- import { OperatingSystemType } from '../../utils/CurrentEnv';
2
- /**
3
- * A service that provides functionality for interacting with the Docker
4
- * application.
5
- */
6
- export default class DockerService {
7
- /**
8
- * Starts the Docker Desktop application. If it is already running, it doesn't
9
- * do anything.
10
- */
11
- static startDockerDesktop(): Promise<void>;
12
- static checkIfDockerDesktopIsRunning(): Promise<boolean>;
13
- /**
14
- * Gets the path to the docker application for the current system given the
15
- * operating system type.
16
- *
17
- * This does include the quotes
18
- */
19
- static getDockerPath(os: OperatingSystemType): string | null;
20
- }
1
+ import { OperatingSystemType } from '../../utils/CurrentEnv';
2
+ /**
3
+ * A service that provides functionality for interacting with the Docker
4
+ * application.
5
+ */
6
+ export default class DockerService {
7
+ /**
8
+ * Starts the Docker Desktop application. If it is already running, it doesn't
9
+ * do anything.
10
+ */
11
+ static startDockerDesktop(): Promise<void>;
12
+ static checkIfDockerDesktopIsRunning(): Promise<boolean>;
13
+ /**
14
+ * Gets the path to the docker application for the current system given the
15
+ * operating system type.
16
+ *
17
+ * This does include the quotes
18
+ */
19
+ static getDockerPath(os: OperatingSystemType): string | null;
20
+ }
21
21
  //# sourceMappingURL=DockerService.d.ts.map