Compare commits
3 Commits
1.0.0
...
11a9a4a929
| Author | SHA1 | Date | |
|---|---|---|---|
| 11a9a4a929 | |||
| 2481d2b616 | |||
| 35612d2f18 |
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "roadsign-cli",
|
||||
"module": "index.ts",
|
||||
"version": "1.0.0",
|
||||
"version": "1.0.1",
|
||||
"repository": "https://github.com/solsynth/roadsign",
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
@@ -33,4 +33,5 @@
|
||||
"figlet": "^1.7.0",
|
||||
"ora": "^8.1.0"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -7,6 +7,7 @@ import * as child_process from "node:child_process"
|
||||
import * as path from "node:path"
|
||||
import { createAuthHeader } from "../utils/auth.ts"
|
||||
import { RsLocalConfig } from "../utils/config-local.ts"
|
||||
import * as os from "node:os"
|
||||
|
||||
export class DeployCommand extends Command {
|
||||
static paths = [[`deploy`]]
|
||||
@@ -40,12 +41,10 @@ export class DeployCommand extends Command {
|
||||
|
||||
let isDirectory = false
|
||||
if (fs.statSync(input).isDirectory()) {
|
||||
input = path.join(input, "*")
|
||||
|
||||
const compressPrefStart = performance.now()
|
||||
const compressSpinner = ora(`Compressing ${chalk.bold(input)}...`).start()
|
||||
const destName = `${Date.now()}-roadsign-archive.zip`
|
||||
child_process.execSync(`zip -rj ${destName} ${input}`)
|
||||
const destName = path.join(os.tmpdir(), `${Date.now()}-roadsign-archive.zip`)
|
||||
child_process.execSync(`cd ${input} && zip -r ${destName} .`)
|
||||
const compressPrefTook = performance.now() - compressPrefStart
|
||||
compressSpinner.succeed(`Compressing completed in ${(compressPrefTook / 1000).toFixed(2)}s 🎉`)
|
||||
input = destName
|
||||
|
||||
Reference in New Issue
Block a user