mirror of
https://github.com/actions/setup-java
synced 2024-11-14 01:22:39 +00:00
code == EEXIST
This commit is contained in:
parent
948db7588e
commit
797045350f
2 changed files with 2 additions and 4 deletions
3
dist/index.js
generated
vendored
3
dist/index.js
generated
vendored
|
@ -4170,12 +4170,11 @@ function write(directory, settings) {
|
||||||
return fs.writeFileSync(location, settings, options);
|
return fs.writeFileSync(location, settings, options);
|
||||||
}
|
}
|
||||||
catch (e) {
|
catch (e) {
|
||||||
if (e.code == fs.constants.O_EXCL) {
|
if (e.code == "EEXIST") {
|
||||||
console.log(`overwriting existing file ${location}`);
|
console.log(`overwriting existing file ${location}`);
|
||||||
// default flag is 'w'
|
// default flag is 'w'
|
||||||
return fs.writeFileSync(location, settings, { encoding: 'utf-8' });
|
return fs.writeFileSync(location, settings, { encoding: 'utf-8' });
|
||||||
}
|
}
|
||||||
console.log(`error ${JSON.stringify(e)} and O_EXCL ${fs.constants.O_EXCL}`);
|
|
||||||
throw e;
|
throw e;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
|
@ -50,12 +50,11 @@ async function write(directory: string, settings: string) {
|
||||||
try {
|
try {
|
||||||
return fs.writeFileSync(location, settings, options);
|
return fs.writeFileSync(location, settings, options);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
if (e.code == fs.constants.O_EXCL) {
|
if (e.code == "EEXIST") {
|
||||||
console.log(`overwriting existing file ${location}`);
|
console.log(`overwriting existing file ${location}`);
|
||||||
// default flag is 'w'
|
// default flag is 'w'
|
||||||
return fs.writeFileSync(location, settings, {encoding: 'utf-8'});
|
return fs.writeFileSync(location, settings, {encoding: 'utf-8'});
|
||||||
}
|
}
|
||||||
console.log(`error ${JSON.stringify(e)} and O_EXCL ${fs.constants.O_EXCL}`);
|
|
||||||
throw e;
|
throw e;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue