fix: use fs-extra for move

This commit is contained in:
Amin Yahyaabadi 2025-01-31 15:40:55 -08:00
parent c2c30d9a33
commit a3723b08a9
12 changed files with 52 additions and 14 deletions

View File

@ -21,6 +21,7 @@ words:
- bazel
- bazelisk
- biome
- mkdirp
- biomejs
- buildtools
- caxa

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -83,6 +83,7 @@
"@types/cross-spawn": "^6.0.6",
"@types/escape-quotes": "~1.0.0",
"@types/eslint": "^9.6.1",
"@types/fs-extra": "^11.0.4",
"@types/iarna__toml": "~2.0.5",
"@types/jest": "^29.5.14",
"@types/memoizee": "^0.4.11",
@ -107,6 +108,7 @@
"eslint-config-atomic": "^1.22.1",
"exec-powershell": "workspace:*",
"execa": "^7",
"fs-extra": "^11.3.0",
"is-url-online": "^1.5.0",
"jest": "^29.7.0",
"lefthook": "^1.10.3",
@ -186,7 +188,8 @@
"untildify-user",
"util.types",
"web-streams-polyfill",
"timers-browserify"
"timers-browserify",
"fs-extra"
],
"engines": {
"node": ">=12.x",

View File

@ -82,6 +82,9 @@ importers:
'@types/eslint':
specifier: ^9.6.1
version: 9.6.1
'@types/fs-extra':
specifier: ^11.0.4
version: 11.0.4
'@types/iarna__toml':
specifier: ~2.0.5
version: 2.0.5
@ -154,6 +157,9 @@ importers:
execa:
specifier: ^7
version: 7.2.0
fs-extra:
specifier: ^11.3.0
version: 11.3.0
is-url-online:
specifier: ^1.5.0
version: 1.5.0
@ -1790,6 +1796,9 @@ packages:
'@types/estree@1.0.6':
resolution: {integrity: sha512-AYnb1nQyY49te+VRAVgmzfcgjYS91mY5P0TKUDCLEM+gNnA+3T6rWITXRLYCpahpqSQbN5cE+gHpnPyXjHWxcw==}
'@types/fs-extra@11.0.4':
resolution: {integrity: sha512-yTbItCNreRooED33qjunPthRcSjERP1r4MqCZc7wv0u2sUkzTFp45tgUfS5+r7FrZPdmCCNflLhVSP/o+SemsQ==}
'@types/glob@7.2.0':
resolution: {integrity: sha512-ZUxbzKl0IfJILTS6t7ip5fQQM/J3TJYubDm3nMbgubNNYS62eXeUpoLUC8/7fJNiFYHTrGPQn7hspDUzIHX3UA==}
@ -1817,6 +1826,9 @@ packages:
'@types/json5@0.0.29':
resolution: {integrity: sha512-dRLjCWHYg4oaA77cxO64oO+7JwCwnIzkZPdrrC71jQmQtlhM556pwKo5bUzqvZndkVbeFLIIi+9TC40JNF5hNQ==}
'@types/jsonfile@6.1.4':
resolution: {integrity: sha512-D5qGUYwjvnNNextdU59/+fI+spnwtTFmyQP0h+PfIOSkNfpU6AOICUOkm4i0OnSk+NyjdPJrxCDro0sJsWlRpQ==}
'@types/mdast@4.0.4':
resolution: {integrity: sha512-kGaNbPh1k7AFzgpud/gMdvIm5xuECykRR+JnWKQno9TAXVa6WIVCGTPvYGekIDL4uwCZQSYbUxNBSb1aUo79oA==}
@ -3082,6 +3094,7 @@ packages:
eslint@8.57.1:
resolution: {integrity: sha512-ypowyDxpVSYpkXr9WPv2PAZCtNip1Mv5KTW0SCurXv/9iOpcrH9PaqUElksqEB6pChqHGDRCFTyrZlGhnLNGiA==}
engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0}
deprecated: This version is no longer supported. Please see https://eslint.org/version-support for other options.
hasBin: true
esniff@2.0.1:
@ -3259,6 +3272,10 @@ packages:
resolution: {integrity: sha512-oRXApq54ETRj4eMiFzGnHWGy+zo5raudjuxN0b8H7s/RU2oW0Wvsx9O0ACRN/kRq9E8Vu/ReskGB5o3ji+FzHQ==}
engines: {node: '>=12'}
fs-extra@11.3.0:
resolution: {integrity: sha512-Z4XaCL6dUDHfP/jT25jJKMmtxvuwbkrD1vNSMFlo9lNLY2c5FHYSQgHPRZUjAB26TpDEoW9HCOgplrdbaPV/ew==}
engines: {node: '>=14.14'}
fs-extra@7.0.1:
resolution: {integrity: sha512-YJDaCJZEnBmcbw13fvdAM9AwNOJwOzrE4pqMqBq5nFiEqXUqHwlK4B+3pUw6JNvfSPtX05xFHtYy/1ni01eGCw==}
engines: {node: '>=6 <7 || >=8'}
@ -4158,9 +4175,11 @@ packages:
lodash.get@4.4.2:
resolution: {integrity: sha512-z+Uw/vLuy6gQe8cfaFWD7p0wVv8fJl3mbzXh33RS+0oW2wvUqiRXiQ69gLWSLpgB5/6sU+r6BlQR0MBILadqTQ==}
deprecated: This package is deprecated. Use the optional chaining (?.) operator instead.
lodash.isequal@4.5.0:
resolution: {integrity: sha512-pDo3lu8Jhfjqls6GkMgpahsF9kCyayhgykjyLMNFTKWrpVdAQtYyB4muAMWozBB4ig/dtWAmsMxLEI8wuz+DYQ==}
deprecated: This package is deprecated. Use require('node:util').isDeepStrictEqual instead.
lodash.isplainobject@4.0.6:
resolution: {integrity: sha512-oSXzaWypCMHkPC3NvBEaPHf0KsA5mvPrOPgQWDsbg8n7orZ290M0BmC/jgRZ4vcJ6DTAhjrsSYgdsW/F+MFOBA==}
@ -7197,6 +7216,11 @@ snapshots:
'@types/estree@1.0.6': {}
'@types/fs-extra@11.0.4':
dependencies:
'@types/jsonfile': 6.1.4
'@types/node': 22.10.5
'@types/glob@7.2.0':
dependencies:
'@types/minimatch': 5.1.2
@ -7229,6 +7253,10 @@ snapshots:
'@types/json5@0.0.29': {}
'@types/jsonfile@6.1.4':
dependencies:
'@types/node': 22.10.5
'@types/mdast@4.0.4':
dependencies:
'@types/unist': 3.0.3
@ -9186,6 +9214,12 @@ snapshots:
jsonfile: 6.1.0
universalify: 2.0.1
fs-extra@11.3.0:
dependencies:
graceful-fs: 4.2.11
jsonfile: 6.1.0
universalify: 2.0.1
fs-extra@7.0.1:
dependencies:
graceful-fs: 4.2.11

View File

@ -1,8 +1,8 @@
import { basename, dirname, join } from "path"
import { mkdirP, mv } from "@actions/io"
import { grantUserWriteAccess } from "admina"
import { info, warning } from "ci-log"
import { execa } from "execa"
import { mkdirp, move } from "fs-extra"
import { rm } from "fs/promises"
import { installAptPack } from "setup-apt"
import which from "which"
@ -83,7 +83,7 @@ export async function extract7Zip(file: string, dest: string) {
const folderName = tarName.slice(0, -4)
const folderPath = join(tarDir, folderName)
info(`Moving ${folderPath} to ${dest}`)
await mv(folderPath, dest, { force: true })
await move(folderPath, dest, { overwrite: true })
} else {
// extract the 7z file directly
await run7zip(file, dest)
@ -137,7 +137,7 @@ export async function extractTarByExe(file: string, dest: string, stripComponent
await installTarDependencies(getArchiveType(file))
try {
await mkdirP(dest)
await mkdirp(dest)
} catch {
// ignore
}