@joystick.js/cli-canary 0.0.0-canary.1671 → 0.0.0-canary.1672
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.
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import
|
|
1
|
+
import r from"os";import s from"fs";import i from"../../lib/path_exists.js";const{readFile:n,mkdir:p,writeFile:m}=s.promises,a=async(e="")=>{const t=r.homedir();if(e)return await i(`${t}/.push`)||await p(`${t}/.push`),await m(`${t}/.push/deployment_token`,e),e;const o=`${t}/.push/deployment_token`;return await i(o)?n(o,"utf-8"):null};var l=a;export{l as default};
|
|
2
2
|
//# sourceMappingURL=get_deployment_token.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/commands/push_v2/get_deployment_token.js"],
|
|
4
|
-
"sourcesContent": ["import os from 'os';\nimport fs from 'fs';\nimport path_exists from '../../lib/path_exists.js';\n\nconst { readFile, mkdir, writeFile } = fs.promises;\n\nconst get_deployment_token = async (deployment_token = '') => { \n if (deployment_token) {\n\t if (!(await path_exists(`${home_directory}/.push`))) {\n\t await mkdir(`${home_directory}/.push`);\n\t }\n\n\t await writeFile(`${home_directory}/.push/deployment_token`, deployment_token);\n\n\t return deployment_token;\n }\n\n const
|
|
5
|
-
"mappings": "AAAA,OAAOA,MAAQ,KACf,OAAOC,MAAQ,KACf,OAAOC,MAAiB,2BAExB,KAAM,CAAE,SAAAC,EAAU,MAAAC,EAAO,UAAAC,CAAU,EAAIJ,EAAG,SAEpCK,EAAuB,MAAOC,EAAmB,KAAO,CAC5D,
|
|
6
|
-
"names": ["os", "fs", "path_exists", "readFile", "mkdir", "writeFile", "get_deployment_token", "deployment_token", "home_directory", "
|
|
4
|
+
"sourcesContent": ["import os from 'os';\nimport fs from 'fs';\nimport path_exists from '../../lib/path_exists.js';\n\nconst { readFile, mkdir, writeFile } = fs.promises;\n\nconst get_deployment_token = async (deployment_token = '') => { \n const home_directory = os.homedir();\n\n if (deployment_token) {\n\t if (!(await path_exists(`${home_directory}/.push`))) {\n\t await mkdir(`${home_directory}/.push`);\n\t }\n\n\t await writeFile(`${home_directory}/.push/deployment_token`, deployment_token);\n\n\t return deployment_token;\n }\n\n const deployment_token_path = `${home_directory}/.push/deployment_token`;\n const deployment_token_exists = await path_exists(deployment_token_path);\n\n if (deployment_token_exists) {\n return readFile(deployment_token_path, 'utf-8');\n }\n\n return null;\n};\n\nexport default get_deployment_token;\n"],
|
|
5
|
+
"mappings": "AAAA,OAAOA,MAAQ,KACf,OAAOC,MAAQ,KACf,OAAOC,MAAiB,2BAExB,KAAM,CAAE,SAAAC,EAAU,MAAAC,EAAO,UAAAC,CAAU,EAAIJ,EAAG,SAEpCK,EAAuB,MAAOC,EAAmB,KAAO,CAC5D,MAAMC,EAAiBR,EAAG,QAAQ,EAElC,GAAIO,EACH,OAAM,MAAML,EAAY,GAAGM,CAAc,QAAQ,GAC/C,MAAMJ,EAAM,GAAGI,CAAc,QAAQ,EAGvC,MAAMH,EAAU,GAAGG,CAAc,0BAA2BD,CAAgB,EAErEA,EAGR,MAAME,EAAwB,GAAGD,CAAc,0BAG/C,OAFgC,MAAMN,EAAYO,CAAqB,EAG9DN,EAASM,EAAuB,OAAO,EAGzC,IACT,EAEA,IAAOC,EAAQJ",
|
|
6
|
+
"names": ["os", "fs", "path_exists", "readFile", "mkdir", "writeFile", "get_deployment_token", "deployment_token", "home_directory", "deployment_token_path", "get_deployment_token_default"]
|
|
7
7
|
}
|
package/package.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@joystick.js/cli-canary",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.0.0-canary.
|
|
5
|
-
"canary_version": "0.0.0-canary.
|
|
4
|
+
"version": "0.0.0-canary.1672",
|
|
5
|
+
"canary_version": "0.0.0-canary.1671",
|
|
6
6
|
"description": "The CLI for Joystick.",
|
|
7
7
|
"main": "dist/index.js",
|
|
8
8
|
"bin": {
|
|
@@ -5,6 +5,8 @@ import path_exists from '../../lib/path_exists.js';
|
|
|
5
5
|
const { readFile, mkdir, writeFile } = fs.promises;
|
|
6
6
|
|
|
7
7
|
const get_deployment_token = async (deployment_token = '') => {
|
|
8
|
+
const home_directory = os.homedir();
|
|
9
|
+
|
|
8
10
|
if (deployment_token) {
|
|
9
11
|
if (!(await path_exists(`${home_directory}/.push`))) {
|
|
10
12
|
await mkdir(`${home_directory}/.push`);
|
|
@@ -15,12 +17,11 @@ const get_deployment_token = async (deployment_token = '') => {
|
|
|
15
17
|
return deployment_token;
|
|
16
18
|
}
|
|
17
19
|
|
|
18
|
-
const
|
|
19
|
-
const
|
|
20
|
-
const session_token_exists = await path_exists(session_token_path);
|
|
20
|
+
const deployment_token_path = `${home_directory}/.push/deployment_token`;
|
|
21
|
+
const deployment_token_exists = await path_exists(deployment_token_path);
|
|
21
22
|
|
|
22
|
-
if (
|
|
23
|
-
return readFile(
|
|
23
|
+
if (deployment_token_exists) {
|
|
24
|
+
return readFile(deployment_token_path, 'utf-8');
|
|
24
25
|
}
|
|
25
26
|
|
|
26
27
|
return null;
|