contensis-cli 1.0.0-beta.6 → 1.0.0-beta.60
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.
- package/README.md +760 -75
- package/dist/commands/connect.js +3 -3
- package/dist/commands/connect.js.map +2 -2
- package/dist/commands/create.js +30 -10
- package/dist/commands/create.js.map +2 -2
- package/dist/commands/diff.js +57 -0
- package/dist/commands/diff.js.map +7 -0
- package/dist/commands/get.js +61 -12
- package/dist/commands/get.js.map +2 -2
- package/dist/commands/globalOptions.js +22 -17
- package/dist/commands/globalOptions.js.map +2 -2
- package/dist/commands/import.js +46 -11
- package/dist/commands/import.js.map +2 -2
- package/dist/commands/index.js +9 -1
- package/dist/commands/index.js.map +2 -2
- package/dist/commands/list.js +19 -8
- package/dist/commands/list.js.map +2 -2
- package/dist/commands/login.js +3 -3
- package/dist/commands/login.js.map +2 -2
- package/dist/commands/push.js +8 -4
- package/dist/commands/push.js.map +2 -2
- package/dist/commands/release.js +47 -0
- package/dist/commands/release.js.map +7 -0
- package/dist/commands/remove.js +40 -8
- package/dist/commands/remove.js.map +2 -2
- package/dist/commands/set.js +53 -12
- package/dist/commands/set.js.map +2 -2
- package/dist/localisation/en-GB.js +100 -48
- package/dist/localisation/en-GB.js.map +2 -2
- package/dist/providers/CredentialProvider.js +36 -7
- package/dist/providers/CredentialProvider.js.map +3 -3
- package/dist/providers/SessionCacheProvider.js +21 -1
- package/dist/providers/SessionCacheProvider.js.map +2 -2
- package/dist/providers/file-provider.js +8 -4
- package/dist/providers/file-provider.js.map +3 -3
- package/dist/services/ContensisCliService.js +640 -375
- package/dist/services/ContensisCliService.js.map +3 -3
- package/dist/shell.js +27 -10
- package/dist/shell.js.map +3 -3
- package/dist/util/console.printer.js +171 -55
- package/dist/util/console.printer.js.map +2 -2
- package/dist/util/index.js +5 -2
- package/dist/util/index.js.map +3 -3
- package/dist/util/logger.js +47 -16
- package/dist/util/logger.js.map +2 -2
- package/dist/version.js +1 -1
- package/dist/version.js.map +1 -1
- package/package.json +2 -2
- package/src/commands/connect.ts +3 -2
- package/src/commands/create.ts +37 -8
- package/src/commands/diff.ts +41 -0
- package/src/commands/get.ts +80 -5
- package/src/commands/globalOptions.ts +18 -17
- package/src/commands/import.ts +57 -7
- package/src/commands/index.ts +9 -1
- package/src/commands/list.ts +35 -9
- package/src/commands/login.ts +3 -2
- package/src/commands/push.ts +9 -2
- package/src/commands/release.ts +32 -0
- package/src/commands/remove.ts +50 -4
- package/src/commands/set.ts +65 -9
- package/src/localisation/en-GB.ts +146 -65
- package/src/providers/CredentialProvider.ts +39 -6
- package/src/providers/SessionCacheProvider.ts +29 -2
- package/src/providers/file-provider.ts +12 -4
- package/src/services/ContensisCliService.ts +789 -426
- package/src/shell.ts +31 -11
- package/src/util/console.printer.ts +240 -78
- package/src/util/index.ts +12 -6
- package/src/util/logger.ts +87 -18
- package/src/version.ts +1 -1
|
@@ -1,8 +1,15 @@
|
|
|
1
1
|
import fs from 'fs';
|
|
2
|
+
import { homedir } from 'os';
|
|
2
3
|
import path from 'path';
|
|
3
|
-
import { path as appRoot } from 'app-root-path';
|
|
4
4
|
import { tryParse } from '~/util';
|
|
5
5
|
|
|
6
|
+
const userHomeDir = homedir();
|
|
7
|
+
|
|
8
|
+
export const appRootDir =
|
|
9
|
+
process.env.CONTAINER_CONTEXT === 'true'
|
|
10
|
+
? process.cwd()
|
|
11
|
+
: path.join(userHomeDir, '.contensis/');
|
|
12
|
+
|
|
6
13
|
export const readJsonFile = <T>(filePath: string) => {
|
|
7
14
|
const file = readFile(filePath);
|
|
8
15
|
if (file) return tryParse(file) as T | string;
|
|
@@ -42,8 +49,8 @@ export const removeFile = (filePath: string) => {
|
|
|
42
49
|
};
|
|
43
50
|
|
|
44
51
|
export const moveFile = (file: string, fromPath: string, toPath: string) => {
|
|
45
|
-
const from = path.join(
|
|
46
|
-
const to = path.join(
|
|
52
|
+
const from = path.join(appRootDir, `${fromPath}${file}`);
|
|
53
|
+
const to = path.join(appRootDir, `${toPath}${file}`);
|
|
47
54
|
if (fs.existsSync(from)) {
|
|
48
55
|
checkDir(toPath);
|
|
49
56
|
// if (!fs.existsSync(toPath)) fs.mkdirSync(toPath, { recursive: true });
|
|
@@ -69,4 +76,5 @@ export const checkDir = (filePath: string) => {
|
|
|
69
76
|
fs.mkdirSync(directoryPath, { recursive: true });
|
|
70
77
|
};
|
|
71
78
|
|
|
72
|
-
export const localPath = (filePath: string) =>
|
|
79
|
+
export const localPath = (filePath: string) =>
|
|
80
|
+
path.isAbsolute(filePath) ? filePath : path.join(appRootDir, filePath);
|