Skip to content
This repository has been archived by the owner on Feb 26, 2020. It is now read-only.

Commit

Permalink
quick readability fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Joshua Mir committed Dec 27, 2018
1 parent b9ff537 commit ddd8088
Showing 1 changed file with 16 additions and 16 deletions.
32 changes: 16 additions & 16 deletions scripts/generate-config-data.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,25 +12,25 @@ const CONFIG_IS = {
};

function fetchSource () {
if (process.env.AUTOGENSCRIPT) {
return fs.readFile(path.resolve(__dirname, '../../parity/cli/mod.rs'), 'UTF-8');
}
return new Promise((resolve, reject) => {
if (!process.env.AUTOGENSCRIPT) {
https.get('https://raw.githubusercontent.com/paritytech/parity/master/parity/cli/mod.rs', res => {
if (res.statusCode !== 200) {
reject(new Error(`Failed to load source code, status code: ${res.statusCode}`));
}
https.get('https://raw.githubusercontent.com/paritytech/parity/master/parity/cli/mod.rs', res => {
if (res.statusCode !== 200) {
reject(new Error(`Failed to load source code, status code: ${res.statusCode}`));
}

res.pipe(bl(function (err, data) {
if (err) {
reject(new Error(err));
}
res.pipe(bl(function (err, data) {
if (err) {
reject(new Error(err));
}

resolve(data.toString());
}));
});
} else {
resolve(fs.readFileSync(path.resolve(__dirname, '../../parity/cli/mod.rs'), 'UTF-8'));
}
});
resolve(data.toString());
}));
});
}
);
}

function getCliOptions (source) {
Expand Down

0 comments on commit ddd8088

Please sign in to comment.