Skip to content
This repository was archived by the owner on Oct 13, 2023. It is now read-only.

Commit 3fb833a

Browse files
committed
Set executable bit for downloaded tool
1 parent 82d346a commit 3fb833a

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

dist/index.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/download.ts

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import os from "os";
2-
import fs from "fs";
2+
import { promises as fs } from 'fs';
33
import path from "path";
44

55
import * as core from "@actions/core";
@@ -69,10 +69,12 @@ export async function downloadFromCache(
6969
const url = buildUrl(crate, version);
7070
const path = targetPath(crate);
7171

72-
if (fs.existsSync(path)) {
72+
try {
73+
await fs.access(path);
74+
7375
core.warning(`Crate ${crate} already exist at ${path}`);
74-
return;
76+
} catch (error) {
77+
await tc.downloadTool(url, path);
78+
await fs.chmod(path, 0o755);
7579
}
76-
77-
await tc.downloadTool(url, path);
7880
}

0 commit comments

Comments
 (0)