Skip to content
This repository has been archived by the owner on Jul 5, 2024. It is now read-only.

fix the upload script #16

Merged
merged 1 commit into from
Dec 26, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions scripts/upload.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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
Expand All @@ -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)) {
Expand Down