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

Begin less reliance on async package: Await as we go #134

Merged
merged 6 commits into from
Aug 10, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Remove async from develop.js
  • Loading branch information
confused-Techie committed Jul 25, 2024
commit 8a613359c14a8d3fccf8e0e1efb584eb54f17eb3
15 changes: 6 additions & 9 deletions src/develop.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ const fs = require('fs');
const path = require('path');

const _ = require('underscore-plus');
const async = require('async');
const yargs = require('yargs');

const config = require('./apm');
Expand Down Expand Up @@ -64,7 +63,7 @@ cmd-shift-o to run the package out of the newly cloned repository.\

return void reject(`No repository URL found for package: ${packageName}`);
}

const message = request.getErrorMessage(body, error);
return void reject(`Request for package information failed: ${message}`);
});
Expand All @@ -90,7 +89,7 @@ cmd-shift-o to run the package out of the newly cloned repository.\
installDependencies(packageDirectory, options) {
process.chdir(packageDirectory);
const installOptions = _.clone(options);

return new Install().run(installOptions);
}

Expand All @@ -117,12 +116,10 @@ cmd-shift-o to run the package out of the newly cloned repository.\

try {
const repoUrl = await this.getRepositoryUrl(packageName);
const tasks = [];
tasks.push(async () => await this.cloneRepository(repoUrl, packageDirectory, options));
tasks.push(async () => await this.installDependencies(packageDirectory, options));
tasks.push(async () => await this.linkPackage(packageDirectory, options));

await async.waterfall(tasks);

await this.cloneRepository(repoUrl, packageDirectory, options);
await this.installDependencies(packageDirectory, options);
await this.linkPackage(packageDirectory, options);
} catch (error) {
return error; //errors as return values atm
}
Expand Down