Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

fix: scope clipboardy and open and warn on error #213

Merged
merged 1 commit into from
Jun 5, 2021
Merged

Conversation

hacdias
Copy link
Member

@hacdias hacdias commented Jun 5, 2021

If the error from #211 is during runtime and not installation, then this should fix it as long as the flag -C is used. I'm not changing the default behavior now (see #212).

This also ensures that using the clipboard and "open" feature do not make the entire process blow up, but just give a warning. Those are non-fundamental functionalities and they're purely there for simplifying the user's life.

I will work on better docs separately.

License: MIT
Signed-off-by: Henrique Dias hacdias@gmail.com

@hacdias
Copy link
Member Author

hacdias commented Jun 5, 2021

@kevincox: could you confirm if this fixes it for you?

License: MIT
Signed-off-by: Henrique Dias <hacdias@gmail.com>
@hacdias hacdias changed the title fix: scope requiring clipboardy and open fix: scope clipboardy and open and warn on error Jun 5, 2021
@kevincox
Copy link
Contributor

kevincox commented Jun 5, 2021

I can confirm that this now fails gracefully:

% nix-shell --pure -p git -p nodejs --run 'npx github:ipfs-shipyard/ipfs-deploy#53cc77d00af75e4aa40633b9f63effd9e0ae7739 d'
📂  Deploying d directory.
📦  Calculating size of d…
🚚  Directory d weighs 447.8 KiB.
⚙️   Validating pinners configurations…
⚙️   Validating DNS providers configurations…
📠  Uploading and pinning to Infura…
📌  Added and pinned to Infura with CID:
🔗  QmNX4bXbY6UCnaNLS3YSjhXWJ8cg94ozhVz28aLiiZjYrs (​https://ipfs.infura.io/ipfs/QmNX4bXbY6UCnaNLS3YSjhXWJ8cg94ozhVz28aLiiZjYrs​)
📋  Copying HTTP gateway URL to clipboard…
⚠️  Could not copy URL to clipboard.
Error: Couldn't find the `xsel` binary and fallback didn't work. On Debian/Ubuntu you can install xsel with: sudo apt install xsel
    at makeError (/home/kevincox/.npm/_npx/4033/lib/node_modules/ipfs-deploy/node_modules/clipboardy/lib/linux.js:14:11)
    at xselWithFallbackSync (/home/kevincox/.npm/_npx/4033/lib/node_modules/ipfs-deploy/node_modules/clipboardy/lib/linux.js:43:10)
    at Object.copySync (/home/kevincox/.npm/_npx/4033/lib/node_modules/ipfs-deploy/node_modules/clipboardy/lib/linux.js:53:3)
    at Object.exports.writeSync (/home/kevincox/.npm/_npx/4033/lib/node_modules/ipfs-deploy/node_modules/clipboardy/index.js:45:14)
    at copyToClipboard (/home/kevincox/.npm/_npx/4033/lib/node_modules/ipfs-deploy/src/deploy.js:107:16)
    at deploy (/home/kevincox/.npm/_npx/4033/lib/node_modules/ipfs-deploy/src/deploy.js:268:5)
    at processTicksAndRejections (internal/process/task_queues.js:95:5)
    at async main (/home/kevincox/.npm/_npx/4033/lib/node_modules/ipfs-deploy/src/cli.js:174:17)

QmNX4bXbY6UCnaNLS3YSjhXWJ8cg94ozhVz28aLiiZjYrs
time Total: 21.922 (56%), User: 10.866, System: 1.467  - nix-shell --pure -p git -p nodejs --run 
% echo $?
0

@hacdias hacdias merged commit 7e15e59 into master Jun 5, 2021
@hacdias hacdias deleted the fix/clipboardy branch June 5, 2021 13:08
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants