diff --git a/README.md b/README.md index 9808fd2..643959e 100644 --- a/README.md +++ b/README.md @@ -31,11 +31,11 @@ Below are the prompts (see the [Notes](#notes) below for an important advisory r ```javascript { name: 'username', - message: 'QuickBase username:' + message: 'QuickBase username (leave blank to use the QUICKBASE_CLI_USERNAME environment variable):' }, { name: 'password', - message: 'QuickBase password (Leave blank to use the QUICKBASE_CLI_PASSWORD env variable):' + message: 'QuickBase password (leave blank to use the QUICKBASE_CLI_PASSWORD environment variable):' }, { name: 'dbid', @@ -47,11 +47,19 @@ Below are the prompts (see the [Notes](#notes) below for an important advisory r }, { name: 'appToken', - message: 'QuickBase application token (if applicable):' + message: 'QuickBase application token (if applicable) (leave blank to use the QUICKBASE_CLI_APPTOKEN environment variable):' +}, +{ + name: 'userToken', + message: 'QuickBase user token (if applicable) (leave blank to use the QUICKBASE_CLI_USERTOKEN environment variable):' }, { name: 'appName', message: 'Code page prefix (leave blank to disable prefixing uploaded pages):' +}, +{ + name: 'ticketExpiryHours', + message: 'Ticket expiry period in hours (default is 1):' } ``` @@ -92,6 +100,8 @@ For now this is only a wrapper around `git clone`. After you pull down a repo yo * Instead of exposing your password for the `quickbase-cli.config.js` file you can rely on an environment variable called `QUICKBASE_CLI_PASSWORD`. If you have that variable defined and leave the `password` empty when prompted the `qb deploy` command will use it instead. Always practice safe passwords. +* The same can also be done with username (using `QUICKBASE_CLI_USERNAME`), user token (using `QUICKBASE_CLI_USERTOKEN`) and/or app token (using `QUICKBASE_CLI_APPTOKEN`). + * ~~Moves are being made to add cool shit like a build process, global defaults, awesome starter templates, and pulling down existing code files from QuickBase. They're not out yet, so for now you're on your own.~~ * I no longer work with QuickBase applications, so the cool shit I had planned won't happen unless someone submits some dope pull requests. diff --git a/bin/qb-deploy.js b/bin/qb-deploy.js index b9075bf..db4f611 100644 --- a/bin/qb-deploy.js +++ b/bin/qb-deploy.js @@ -43,7 +43,14 @@ if (program.watch) { async function qbDeploy(source) { console.log('Uploading files to QuickBase...'); - + + try { + await api.authenticateIfNeeded(); + } catch(e) { + console.error(e); + return; + } + const stats = await fs.statSync(source); const isFile = stats.isFile(); diff --git a/bin/qb-init.js b/bin/qb-init.js index 30c7e65..c694ff1 100644 --- a/bin/qb-init.js +++ b/bin/qb-init.js @@ -8,7 +8,7 @@ const QUESTIONS = [ { type: 'input', name: 'username', - message: 'QuickBase username:' + message: 'QuickBase username (leave blank to use the QUICKBASE_CLI_USERNAME environment variable):' }, { type: 'password', @@ -29,13 +29,24 @@ const QUESTIONS = [ { type: 'input', name: 'appToken', - message: 'QuickBase application token (if applicable):' + message: 'QuickBase application token (if applicable) (leave blank to use the QUICKBASE_CLI_APPTOKEN environment variable):' + }, + { + type: 'input', + name: 'userToken', + message: 'QuickBase user token (if applicable) (leave blank to use the QUICKBASE_CLI_USERTOKEN environment variable):' }, { type: 'input', name: 'appName', message: 'Code page prefix (leave blank to disable prefixing uploaded pages):' + }, + { + type: 'input', + name: 'authenticate_hours', + message: + 'Authentication expiry period in hours (default is 1):' } ]; diff --git a/demo/index.html b/demo/index.html index 51990da..f77347f 100644 --- a/demo/index.html +++ b/demo/index.html @@ -7,7 +7,9 @@
This is a page, that should be deployed using quickbase-cli to quickbase, with styling and scripts properly referenced.
+If this paragraph is bold, CSS files are properly referenced.
+If this paragraph is bold, JS files are properly referenced.