mirror of
https://github.com/dawidd6/action-ansible-playbook.git
synced 2024-11-22 15:32:18 +00:00
post: check if file exists before unlinking
This commit is contained in:
parent
145a900758
commit
81f2a15778
1 changed files with 4 additions and 2 deletions
2
post.js
2
post.js
|
@ -2,9 +2,11 @@ const core = require('@actions/core')
|
||||||
const fs = require('fs')
|
const fs = require('fs')
|
||||||
|
|
||||||
function rm(file) {
|
function rm(file) {
|
||||||
|
if (fs.existsSync(file)) {
|
||||||
core.info(`==> Deleting "${file}" file`)
|
core.info(`==> Deleting "${file}" file`)
|
||||||
fs.unlinkSync(file)
|
fs.unlinkSync(file)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
async function main() {
|
async function main() {
|
||||||
try {
|
try {
|
||||||
|
|
Loading…
Reference in a new issue