mirror of
https://github.com/bcomnes/deploy-to-neocities.git
synced 2026-01-16 22:56:28 +00:00
Print file stats when things error.
This commit is contained in:
parent
e3a5a21e0f
commit
06656fc11f
14
index.js
14
index.js
@ -6,10 +6,12 @@ const ms = require('ms')
|
||||
const assert = require('webassert').default
|
||||
const fsp = require('fs').promises
|
||||
|
||||
let cleanup
|
||||
|
||||
async function doDeploy () {
|
||||
const token = core.getInput('api_token')
|
||||
const distDir = path.join(process.cwd(), core.getInput('dist_dir'))
|
||||
const cleanup = JSON.parse(core.getInput('cleanup'))
|
||||
cleanup = JSON.parse(core.getInput('cleanup'))
|
||||
|
||||
assert(typeof cleanup === 'boolean', 'Cleanup input must be a boolean "true" or "false"')
|
||||
const stat = await fsp.stat(distDir)
|
||||
@ -30,5 +32,15 @@ async function doDeploy () {
|
||||
|
||||
doDeploy().catch(err => {
|
||||
console.error(err)
|
||||
if (err.stats) {
|
||||
console.log('Files to upload: ')
|
||||
console.dir(err.stats.filesToUpload, { colors: true, depth: 999 })
|
||||
|
||||
if (cleanup) {
|
||||
console.log('Files to delete: ')
|
||||
console.dir(err.stats.filesToDelete, { colors: true, depth: 999 })
|
||||
}
|
||||
}
|
||||
|
||||
core.setFailed(err.message)
|
||||
})
|
||||
|
||||
@ -8,9 +8,9 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"@actions/core": "1.2.6",
|
||||
"async-neocities": "1.1.6",
|
||||
"ms": "^2.1.2",
|
||||
"webassert": "^3.0.2"
|
||||
"async-neocities": "1.1.7",
|
||||
"ms": "2.1.2",
|
||||
"webassert": "3.0.2"
|
||||
},
|
||||
"devDependencies": {
|
||||
"auto-changelog": "^2.0.0",
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user