Compare commits

3 Commits

Author SHA1 Message Date
11a9a4a929 🚀 Launch bug hotfix cli 2024-10-03 15:31:34 +08:00
2481d2b616 🐛 Fix cd with asterisk 2024-10-03 15:21:01 +08:00
35612d2f18 🐛 Fix deploy command compress issue 2024-10-03 15:19:34 +08:00
2 changed files with 6 additions and 6 deletions

View File

@@ -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"
}
}
}

View File

@@ -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