From f288fd1650119bf285288a1a96dbb54860bd80e6 Mon Sep 17 00:00:00 2001 From: Bret Comnes Date: Mon, 10 Feb 2020 13:37:23 -0700 Subject: [PATCH] initial attempt --- .github/workflows/example.yml => example.yml | 0 index.js | 20 ++++---------------- 2 files changed, 4 insertions(+), 16 deletions(-) rename .github/workflows/example.yml => example.yml (100%) diff --git a/.github/workflows/example.yml b/example.yml similarity index 100% rename from .github/workflows/example.yml rename to example.yml diff --git a/index.js b/index.js index 0f79983..6e29d94 100644 --- a/index.js +++ b/index.js @@ -5,9 +5,8 @@ const path = require('path') const exec = require('child_process').exec async function doDeploy () { - // `who-to-greet` input defined in action metadata file const token = core.getInput('api-token') - const distDir = core.getInput('dist-dir') + const distDir = path.join(process.cwd(), core.getInput('dist-dir')) const cleanup = core.getInput('cleanup') const time = (new Date()).toTimeString() @@ -15,21 +14,10 @@ async function doDeploy () { const client = new Neocities(token) - console.log(process.cwd()) - console.log(path.join(process.cwd(), distDir)) - - return new Promise((resolve, reject) => { - exec('ls -la', (error, stdout, stderr) => { - console.log(stdout) - console.log(stderr) - if (error !== null) { - console.log(`exec error: ${error}`) - } - resolve() - }) + return client.deploy(distDir, { + cleanup, + statusCb: console.log }) - - // return client.deploy() } doDeploy().then(() => {}).catch(err => {