Skip to content

Commit

Permalink
[cli] Copy xdg-open binary to bin directory on pack
Browse files Browse the repository at this point in the history
  • Loading branch information
rexxars committed Nov 21, 2017
1 parent 7329229 commit 78ddc6e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
3 changes: 3 additions & 0 deletions packages/@sanity/cli/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,6 @@ node_modules

# Packed version of Sanity binary
/bin/sanity

# Dependency of opn module
/bin/xdg-open
4 changes: 4 additions & 0 deletions packages/@sanity/cli/scripts/pack.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@ if (bindings.length > 0) {
process.exit(1)
}

const opnDir = path.dirname(require.resolve('opn'))
const xdgPath = path.join(opnDir, 'xdg-open')
fse.copy(xdgPath, path.join(basedir, 'bin', 'xdg-open'))

const babelRc = JSON.parse(fse.readFileSync(path.join(basedir, '.babelrc'), 'utf8'))

// Use the real node __dirname and __filename in order to get Yarn's source
Expand Down

0 comments on commit 78ddc6e

Please sign in to comment.