Merge pull request #14 from dawidd6/check-file-exists

Check if file exists before unlinking
This commit is contained in:
Dawid Dziurla
2020-12-06 16:56:26 +01:00
committed by GitHub
2 changed files with 12 additions and 2 deletions

View File

@@ -67,3 +67,11 @@ jobs:
options: |
-e key1=val1
-e key2=val2
- name: Test local
uses: ./
with:
playbook: playbook.yml
vault_password: test
inventory: |
[all]
localhost ansible_connection=local

View File

@@ -2,8 +2,10 @@ const core = require('@actions/core')
const fs = require('fs')
function rm(file) {
core.info(`==> Deleting "${file}" file`)
fs.unlinkSync(file)
if (fs.existsSync(file)) {
core.info(`==> Deleting "${file}" file`)
fs.unlinkSync(file)
}
}
async function main() {