Skip to content

Commit 2d4e2c9

Browse files
committed
fix: print pinned hash to stdout
Makes it easier to integrate with other tools like lexicon: https://github.com/AnalogJ/lexicon refs #9, thanks @Alexander255 for the heads up!
1 parent 4cbe850 commit 2d4e2c9

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

bin/ipfs-deploy.js

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ const parser = yargs
2828
.options({
2929
C: {
3030
alias: 'no-clipboard',
31+
type: 'boolean',
3132
describe: "DON'T copy ipfs.io/ipfs/<hash> to clipboard",
3233
},
3334
d: {
@@ -36,6 +37,7 @@ const parser = yargs
3637
describe: 'DNS provider whose dnslink TXT field will be updated',
3738
},
3839
O: {
40+
alias: 'no-open',
3941
type: 'boolean',
4042
describe: "DON'T open URL after deploying",
4143
},
@@ -98,10 +100,10 @@ async function main() {
98100
const deployOptions = {
99101
publicDirPath: argv.path,
100102
copyHttpGatewayUrlToClipboard: !argv.noClipboard,
101-
open: !argv.O,
102103
port: argv.port,
103-
remotePinners: argv.p,
104-
dnsProviders: argv.d,
104+
open: !argv.noOpen,
105+
remotePinners: argv.pinner,
106+
dnsProviders: argv.dns,
105107
siteDomain: argv.siteDomain,
106108
credentials: {
107109
cloudflare: {
@@ -132,7 +134,9 @@ async function main() {
132134
`)
133135
} else {
134136
const pinnedHash = await deploy(deployOptions)
135-
if (!pinnedHash) {
137+
if (pinnedHash) {
138+
process.stdout.write(pinnedHash + '\n')
139+
} else {
136140
process.exit(1)
137141
}
138142
}

0 commit comments

Comments
 (0)