mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-20 01:38:19 +08:00
install: rollback resolution field
This commit is contained in:
1 parent
fcc4eedd9f
commit
63f3202241
1 file changed
+12
-1
+12
-1
@@ -120,11 +120,12 @@ uid: 1536
|
||||
gid: 1536
|
||||
`;
|
||||
|
||||
let data;
|
||||
function removeOptionalEsbuildDeps() {
|
||||
const yarnGlobalPath = exec('yarn global dir').output?.trim() || '';
|
||||
if (!yarnGlobalPath) return false;
|
||||
const pkgjson = `${yarnGlobalPath}/package.json`;
|
||||
const data = existsSync(pkgjson) ? require(pkgjson) : {};
|
||||
data = existsSync(pkgjson) ? require(pkgjson) : {};
|
||||
data.resolutions = data.resolutions || {};
|
||||
Object.assign(data.resolutions, Object.fromEntries([
|
||||
'@esbuild/linux-loong64',
|
||||
@@ -142,6 +143,15 @@ function removeOptionalEsbuildDeps() {
|
||||
return true;
|
||||
}
|
||||
|
||||
function rollbackResolveField() {
|
||||
const yarnGlobalPath = exec('yarn global dir').output?.trim() || '';
|
||||
if (!yarnGlobalPath) return false;
|
||||
const pkgjson = `${yarnGlobalPath}/package.json`;
|
||||
delete data.resolutions;
|
||||
writeFileSync(pkgjson, JSON.stringify(data, null, 2));
|
||||
return true;
|
||||
}
|
||||
|
||||
const steps = [
|
||||
{
|
||||
init: 'install.preparing',
|
||||
@@ -259,6 +269,7 @@ const steps = [
|
||||
},
|
||||
() => log.info('extra.dbUser'),
|
||||
() => log.info('extra.dbPassword', password),
|
||||
() => rollbackResolveField(),
|
||||
],
|
||||
},
|
||||
];
|
||||
|
||||
Reference in new issue
Block a user