Skip to content
This repository has been archived by the owner on May 24, 2022. It is now read-only.

Commit

Permalink
Use path.join in fetch-latest-parity.js (#489)
Browse files Browse the repository at this point in the history
  • Loading branch information
axelchalon authored and Tbaut committed Apr 2, 2019
1 parent 0f36f18 commit 7dce51a
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions scripts/fetch-latest-parity.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,16 @@ switch (process.platform) {

const ENDPOINT = `https://vanity-service.parity.io/parity-binaries?os=${os}&architecture=x86_64`;

const STATIC_DIRECTORY = '../packages/fether-electron/static/';
const STATIC_DIRECTORY = path.join(
'..',
'packages',
'fether-electron',
'static'
);

const foundPath = [
path.join(STATIC_DIRECTORY, '/parity'),
path.join(STATIC_DIRECTORY, '/parity.exe')
path.join(STATIC_DIRECTORY, 'parity'),
path.join(STATIC_DIRECTORY, 'parity.exe')
].find(existsSync);

if (foundPath) {
Expand Down Expand Up @@ -124,7 +129,7 @@ function downloadParity () {
}

// Write to file and set a+x permissions
const destinationPath = `${STATIC_DIRECTORY}/${name}`;
const destinationPath = path.join(STATIC_DIRECTORY, name);
return fsWriteFile(destinationPath, data)
.then(() => fsChmod(destinationPath, 0o755)) // https://nodejs.org/api/fs.html#fs_fs_chmod_path_mode_callback
.then(() => destinationPath);
Expand Down

0 comments on commit 7dce51a

Please sign in to comment.