@pinpt/cli
Advanced tools
+31
-4
@@ -0,1 +1,2 @@ | ||
| import prompts from 'prompts'; | ||
| import fs from 'fs'; | ||
@@ -10,3 +11,4 @@ import path from 'path'; | ||
| import progress from 'cli-progress'; | ||
| import { debug, error, walkSync, apiRequest, readPinpointConfig } from './util.mjs'; | ||
| import terminalLink from 'terminal-link'; | ||
| import { debug, error, walkSync, apiRequest, readPinpointConfig, tick } from './util.mjs'; | ||
@@ -61,4 +63,20 @@ const createMatcher = (buf) => { | ||
| const confirmPrompt = () => { | ||
| return prompts( | ||
| { | ||
| type: 'confirm', | ||
| name: 'value', | ||
| message: 'Confirm you want to deploy site?', | ||
| initial: true, | ||
| }, | ||
| { | ||
| onCancel: () => { | ||
| process.exit(0); | ||
| }, | ||
| } | ||
| ); | ||
| }; | ||
| const upload = async (fn, config) => { | ||
| const { siteId } = readPinpointConfig(config); | ||
| const { siteId, slug, apihost } = readPinpointConfig(config); | ||
| if (!siteId) { | ||
@@ -68,2 +86,8 @@ throw new Error(`No required siteId variable found in ${config}`); | ||
| const ok = await confirmPrompt(); | ||
| if (!ok.value) { | ||
| console.log(c.red('x') + c.bold(' Cancelled')); | ||
| process.exit(0); | ||
| } | ||
| const showProgress = fs.statSync(fn).size > minSizeToShowProgressBar; | ||
@@ -85,3 +109,3 @@ | ||
| const spinner = ora({ text: 'Validating ...', discardStdin: true, interval: 80 }); | ||
| const spinner = ora({ text: 'Validating ... ', discardStdin: true, interval: 80 }); | ||
| if (!p) { | ||
@@ -109,3 +133,6 @@ spinner.start(); | ||
| spinner.succeed(c.bold('Deployed ... 🚀')); | ||
| const baseUrl = (apihost || '').includes('edge') ? 'https://home.edge.pinpoint.com' : 'https://home.pinpoint.com'; | ||
| spinner.succeed(c.bold('Deployed ... 🚀 ')); | ||
| tick(terminalLink('View Deployment Status', `${baseUrl}/${slug}/settings/deployments`)); | ||
| }; | ||
@@ -112,0 +139,0 @@ |
+1
-1
| { | ||
| "name": "@pinpt/cli", | ||
| "version": "0.0.6", | ||
| "version": "0.0.7", | ||
| "description": "Pinpoint CLI", | ||
@@ -5,0 +5,0 @@ "bin": { |
Debug access
Supply chain riskUses debug, reflection and dynamic code execution features.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 2 instances in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
Found 1 instance in 1 package
Debug access
Supply chain riskUses debug, reflection and dynamic code execution features.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 2 instances in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
Found 1 instance in 1 package
27512
2.44%963
2.56%