mirror of
https://github.com/actions/setup-java.git
synced 2024-11-23 10:09:03 +00:00
Be explicit about second flag
This commit is contained in:
parent
5e29577d7b
commit
8940139ee8
@ -50,9 +50,8 @@ async function write(directory: string, settings: string) {
|
|||||||
return fs.writeFileSync(location, settings, options);
|
return fs.writeFileSync(location, settings, options);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
if (e.code == "EEXIST") {
|
if (e.code == "EEXIST") {
|
||||||
console.log(`overwriting existing file ${location}`);
|
console.warn(`overwriting existing file ${location}`);
|
||||||
// default flag is 'w'
|
return fs.writeFileSync(location, settings, {encoding: 'utf-8', flag: 'w'});
|
||||||
return fs.writeFileSync(location, settings, {encoding: 'utf-8'});
|
|
||||||
}
|
}
|
||||||
throw e;
|
throw e;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user