Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

try extension first before shortcuts #1095

Merged
merged 1 commit into from
Apr 4, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
7 changes: 4 additions & 3 deletions bin/cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,10 @@ function syncShorthand (opts) {
if (!opts._.length) return usage(opts)
debug('Sync shortcut command')

debug('Trying extension', opts._[0])
// First try extension
if (config.extensions.indexOf(opts._[0]) > -1) return require('../src/extensions')(opts)

var parsed = require('../src/parse-args')(opts)

// Download Key
Expand All @@ -138,9 +142,6 @@ function syncShorthand (opts) {
return require('../src/commands/share').command(opts)
}

// If directory sync fails, finally try extension
if (config.extensions.indexOf(opts._[0]) > -1) return require('../src/extensions')(opts)

// All else fails, show usage
return usage(opts)
}
Expand Down