Skip to content

Bump eslint-plugin-promise from 5.2.0 to 7.1.0 #20

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Sep 14, 2024
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ jobs:
$env:NODE_OPTIONS="--openssl-legacy-provider --no-experimental-fetch"
node build/package.js
- name: Publish extension VSIX as artifact
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v4
with:
name: VS Code extension VSIXes (${{ matrix.os }})
path: out/vsix
Expand Down
80 changes: 42 additions & 38 deletions build/downloadAssets.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

const { execSync } = require("child_process");
const { createHash } = require("crypto");
const { readFileSync, mkdirSync, rmSync, renameSync } = require("fs");
const { readFileSync, mkdirSync, rmSync, renameSync, existsSync } = require("fs");
const { resolve } = require("path");

function run(command) {
Expand All @@ -24,48 +24,52 @@ for (const asset in config.assets) {
for (const platform of platforms) {
const directory = resolve(__dirname, "..", "assets", "platform", platform);
const destination = resolve(directory, asset);
const extractDirectory = resolve(directory, "arduino-cli");
// Check if the asset has already been downloaded
if (!existsSync(extractDirectory)) {

// Download the asset.
run([
"curl",
`https://github.com/arduino/arduino-cli/releases/download/${config.version}/${asset}`,
"--location",
`--output-dir ${directory}`,
`--remote-name`,
"--silent",
"--show-error",
].join(" "));
// Download the asset.
run([
"curl",
`https://github.com/arduino/arduino-cli/releases/download/${config.version}/${asset}`,
"--location",
`--output-dir ${directory}`,
`--remote-name`,
"--silent",
"--show-error",
].join(" "));

// Verify the hash.
const actualHash = createHash("sha256")
.update(readFileSync(destination))
.digest("hex");
if (actualHash !== hash) {
throw new Error(
`Hash mismatch for ${asset} on ${platform}. Expected ${hash} but got ${actualHash}.`
);
}
// Verify the hash.
const actualHash = createHash("sha256")
.update(readFileSync(destination))
.digest("hex");
if (actualHash !== hash) {
throw new Error(
`Hash mismatch for ${asset} on ${platform}. Expected ${hash} but got ${actualHash}.`
);
}


// Extract to an "arduino-cli" directory.
const extractDirectory = resolve(directory, "arduino-cli");
mkdirSync(extractDirectory, { recursive: true });
// tar on Linux doesn't understand zip files.
if (asset.endsWith(".zip") && process.platform === 'linux') {
run(`unzip ${destination} -d ${extractDirectory}`);
} else {
run(`tar -xf ${destination} -C ${extractDirectory}`);
}
// Extract to an "arduino-cli" directory.
mkdirSync(extractDirectory, { recursive: true });
// tar on Linux doesn't understand zip files.
if (asset.endsWith(".zip") && process.platform === 'linux') {
run(`unzip ${destination} -d ${extractDirectory}`);
} else {
run(`tar -xf ${destination} -C ${extractDirectory}`);
}

// Remove the downloaded archive. We don't need to ship it.
rmSync(destination);
// Remove the downloaded archive. We don't need to ship it.
rmSync(destination);

// VSIX signing will silently strip any extensionless files. Artificially
// add a ".app" extension to extensionless executables.
const executable = resolve(extractDirectory, "arduino-cli");
try {
renameSync(executable, `${executable}.app`);
} catch {
// The file might not exist. This is expected for Windows.
// VSIX signing will silently strip any extensionless files. Artificially
// add a ".app" extension to extensionless executables.
const executable = resolve(extractDirectory, "arduino-cli");
try {
renameSync(executable, `${executable}.app`);
} catch {
// The file might not exist. This is expected for Windows.
}
}
}
}
Expand Down
Loading
Loading