Skip to content

Commit

Permalink
fix: print pinned hash to stdout
Browse files Browse the repository at this point in the history
Makes it easier to integrate with other tools like lexicon:
https://github.com/AnalogJ/lexicon

refs #9, thanks @Alexander255 for the heads up!
  • Loading branch information
agentofuser committed Jun 7, 2019
1 parent 4cbe850 commit 2d4e2c9
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions bin/ipfs-deploy.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ const parser = yargs
.options({
C: {
alias: 'no-clipboard',
type: 'boolean',
describe: "DON'T copy ipfs.io/ipfs/<hash> to clipboard",
},
d: {
Expand All @@ -36,6 +37,7 @@ const parser = yargs
describe: 'DNS provider whose dnslink TXT field will be updated',
},
O: {
alias: 'no-open',
type: 'boolean',
describe: "DON'T open URL after deploying",
},
Expand Down Expand Up @@ -98,10 +100,10 @@ async function main() {
const deployOptions = {
publicDirPath: argv.path,
copyHttpGatewayUrlToClipboard: !argv.noClipboard,
open: !argv.O,
port: argv.port,
remotePinners: argv.p,
dnsProviders: argv.d,
open: !argv.noOpen,
remotePinners: argv.pinner,
dnsProviders: argv.dns,
siteDomain: argv.siteDomain,
credentials: {
cloudflare: {
Expand Down Expand Up @@ -132,7 +134,9 @@ async function main() {
`)
} else {
const pinnedHash = await deploy(deployOptions)
if (!pinnedHash) {
if (pinnedHash) {
process.stdout.write(pinnedHash + '\n')
} else {
process.exit(1)
}
}
Expand Down

0 comments on commit 2d4e2c9

Please sign in to comment.