From b81e03a1c2dff6bf1d16f4725aa28f034188a5e0 Mon Sep 17 00:00:00 2001 From: bohan Date: Tue, 26 Dec 2023 11:57:41 +0800 Subject: [PATCH] fix the upload script --- scripts/upload.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/scripts/upload.js b/scripts/upload.js index dec5254..70c5298 100644 --- a/scripts/upload.js +++ b/scripts/upload.js @@ -3,6 +3,7 @@ const fs = require('fs/promises'); const fsSync = require('fs'); const { spawn } = require('child_process'); const { PACKAGE_DIR, ROOT_DIR, readCompat } = require('./utils'); +const assert = require('assert'); async function runCommand( command, @@ -30,7 +31,7 @@ async function runCommand( throw new Error(`${command} ${args.join(" ")} failed with ${exitCode}`); } -const dataDir = path.resolve(root, '.data'); +const dataDir = path.resolve(ROOT_DIR, '.data'); /** * @param {string[]} args @@ -43,9 +44,9 @@ async function run(args) { await fs.writeFile(abs, jsonStr) const token = args[0]; - ok(typeof token === 'string'); + assert(typeof token === 'string'); const GITHUB_ACTOR = process.env.GITHUB_ACTOR; - ok(typeof GITHUB_ACTOR === 'string'); + assert(typeof GITHUB_ACTOR === 'string'); const repoUrl = `https://${GITHUB_ACTOR}:${token}@github.com/web-infra-dev/rspack-compat.git`; if (!fsSync.existsSync(dataDir)) {