codify-plugin-lib 1.0.182-beta19 → 1.0.182-beta20
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.
|
@@ -2,6 +2,12 @@ export declare class FileUtils {
|
|
|
2
2
|
static downloadFile(url: string, destination: string): Promise<void>;
|
|
3
3
|
static addToShellRc(line: string): Promise<void>;
|
|
4
4
|
static addAllToShellRc(lines: string[]): Promise<void>;
|
|
5
|
+
/**
|
|
6
|
+
* This method adds a directory path to the shell rc file if it doesn't already exist.
|
|
7
|
+
*
|
|
8
|
+
* @param value - The directory path to add.
|
|
9
|
+
* @param prepend - Whether to prepend the path to the existing PATH variable.
|
|
10
|
+
*/
|
|
5
11
|
static addPathToShellRc(value: string, prepend: boolean): Promise<void>;
|
|
6
12
|
static dirExists(path: string): Promise<boolean>;
|
|
7
13
|
static fileExists(path: string): Promise<boolean>;
|
package/dist/utils/file-utils.js
CHANGED
|
@@ -39,8 +39,14 @@ export class FileUtils {
|
|
|
39
39
|
${lines.join('\n')}`);
|
|
40
40
|
await fs.appendFile(shellRc, formattedLines);
|
|
41
41
|
}
|
|
42
|
+
/**
|
|
43
|
+
* This method adds a directory path to the shell rc file if it doesn't already exist.
|
|
44
|
+
*
|
|
45
|
+
* @param value - The directory path to add.
|
|
46
|
+
* @param prepend - Whether to prepend the path to the existing PATH variable.
|
|
47
|
+
*/
|
|
42
48
|
static async addPathToShellRc(value, prepend) {
|
|
43
|
-
if (
|
|
49
|
+
if (await Utils.isDirectoryOnPath(value)) {
|
|
44
50
|
return;
|
|
45
51
|
}
|
|
46
52
|
const shellRc = Utils.getPrimaryShellRc();
|
package/package.json
CHANGED
package/src/utils/file-utils.ts
CHANGED
|
@@ -55,8 +55,14 @@ ${lines.join('\n')}`)
|
|
|
55
55
|
await fs.appendFile(shellRc, formattedLines)
|
|
56
56
|
}
|
|
57
57
|
|
|
58
|
+
/**
|
|
59
|
+
* This method adds a directory path to the shell rc file if it doesn't already exist.
|
|
60
|
+
*
|
|
61
|
+
* @param value - The directory path to add.
|
|
62
|
+
* @param prepend - Whether to prepend the path to the existing PATH variable.
|
|
63
|
+
*/
|
|
58
64
|
static async addPathToShellRc(value: string, prepend: boolean): Promise<void> {
|
|
59
|
-
if (
|
|
65
|
+
if (await Utils.isDirectoryOnPath(value)) {
|
|
60
66
|
return;
|
|
61
67
|
}
|
|
62
68
|
|