Skip to content

Commit

Permalink
Minior ouput tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
bcomnes committed Jul 25, 2018
1 parent 41f5fc3 commit b36c25e
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 15 deletions.
10 changes: 8 additions & 2 deletions src/commands/deploy/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ const path = require('path')
const get = require('lodash.get')
const fs = require('fs')
const cliUx = require('cli-ux').default
const prettyjson = require('prettyjson')

const ensureDirectory = resolvedDeployPath => {
let stat
Expand Down Expand Up @@ -73,8 +74,13 @@ class DeployCommand extends Command {
} catch (e) {
this.error(JSON.stringify(e, null, ' '))
}
cliUx.action.stop('Finished deploy')
console.log(results)
cliUx.action.stop(`Finished deploy ${results.deployId}`)
this.log(
prettyjson.render({
URL: results.deploy.ssl_url || results.deploy.url,
Admin: results.deploy.admin_url
})
)
}
}

Expand Down
6 changes: 3 additions & 3 deletions src/utils/api/deploy/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,14 @@ module.exports = async (api, siteId, dir, opts) => {
)

const { files, shaMap } = await fileHasher(dir, opts)
console.log(files)
console.log(`Hashed ${Object.keys(files).length} files`)
let deploy = await api.createSiteDeploy(siteId, { files }, {})

const { id: deployId, required } = deploy
const uploadList = getUploadList(required, shaMap)
console.log(uploadList)
console.log(`Deploy requested ${uploadList.length} files`)
await uploadFiles(api, deployId, uploadList)

console.log(`Done uploading files. Waiting on deploy...`)
// Update deploy object
deploy = await waitForDeploy(api, deployId, opts.deployTimeout)

Expand Down
20 changes: 10 additions & 10 deletions src/utils/site-config/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ console.log(conf.get('awesome'));

## API

### SiteConfig(projectDir, [options])
### `SiteConfig(projectDir, [options])`

Returns a new instance.

Expand All @@ -56,39 +56,39 @@ An array of file names that indicate a project root, when looking to find a loca

You can use [dot-notation](https://github.com/sindresorhus/dot-prop) in a `key` to access nested properties.

### .set(key, value)
### `.set(key, value)`

Set an item.

### .set(object)
### `.set(object)`

Set multiple items at once.

### .get(key)
### `.get(key)`

Get an item.

### .has(key)
### `.has(key)`

Check if an item exists.

### .delete(key)
### `.delete(key)`

Delete an item.

### .clear()
### `.clear()`

Delete all items.

### .size
### `.size`

Get the item count.

### .path
### `.path`

Get the path to the config file. Can be used to show the user where the config file is located or even better open it for them.

### .all
### `.all`

Get all the config as an object or replace the current config with an object:

Expand Down

0 comments on commit b36c25e

Please sign in to comment.