Skip to content

Commit 2cf8055

Browse files
committed
Remove yarn.
1 parent 5225a8f commit 2cf8055

File tree

2 files changed

+18
-39
lines changed

2 files changed

+18
-39
lines changed

scripts/install

+17-38
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,14 @@
1313
// See the License for the specific language governing permissions and
1414
// limitations under the License.
1515

16-
const async = require('async');
17-
const path = require('path');
16+
var async = require('async');
17+
var path = require('path');
1818

1919
require('shelljs/global');
2020

2121
// Install NPM dependencies, in up to 7 directories at a time
22-
const queue = async.queue((directory, cb) => {
23-
installForDirectory(directory, cb);
22+
var queue = async.queue(function (directory, callback) {
23+
installForDirectory(directory, callback);
2424
}, 7);
2525

2626
queueDirectories('appengine');
@@ -47,39 +47,16 @@ queue.push('vision');
4747
* Install NPM dependencies within a single directory.
4848
*
4949
* @param {string} directory The name of the directory in which to install dependencies.
50-
* @param {function} cb The callback function.
50+
* @param {function} callback The callback function.
5151
*/
52-
function installForDirectory (directory, cb) {
53-
console.log(`${directory}...installing dependencies`);
54-
exec('yarn install', {
52+
function installForDirectory(directory, callback) {
53+
console.log(directory + '...installing dependencies');
54+
exec('npm install', {
5555
async: true,
5656
cwd: path.join(__dirname, '../', directory)
57-
}, (err) => {
58-
if (err) {
59-
cd(directory);
60-
61-
// Uninstall dependencies
62-
console.log(`Retrying in ${directory} with NPM...`);
63-
rm('-rf', 'node_modules');
64-
65-
// Move out of the directory
66-
cd('..');
67-
exec('npm install', {
68-
async: true,
69-
cwd: path.join(__dirname, '../', directory)
70-
}, (err) => {
71-
if (err) {
72-
console.error(`Failed to install dependencies in ${directory}!`);
73-
throw err;
74-
} else {
75-
console.log(`${directory}...done`);
76-
cb();
77-
}
78-
});
79-
} else {
80-
console.log(`${directory}...done`);
81-
cb();
82-
}
57+
}, function (err) {
58+
console.log(directory + '...done');
59+
callback(err);
8360
});
8461
}
8562

@@ -88,18 +65,20 @@ function installForDirectory (directory, cb) {
8865
*
8966
* @param {string} directory The name of the directory in which to recursively install dependencies.
9067
*/
91-
function queueDirectories (directory) {
68+
function queueDirectories(directory) {
9269
// Move into the directory
9370
cd(directory);
9471

9572
// List the files in the directory
9673
ls('-dl', '*')
97-
.filter((file) => {
74+
.filter(function (file) {
9875
// Find the directories within the directory
9976
return file.isDirectory() && file.name !== 'test' && file.name !== 'system-test';
10077
})
101-
.forEach((file) => queue.push(`${directory}/${file.name}`));
78+
.forEach(function (file) {
79+
queue.push(directory + '/' + file.name);
80+
});
10281

10382
// Move out of the directory
10483
cd('..');
105-
}
84+
}

scripts/uninstall

+1-1
Original file line numberDiff line numberDiff line change
@@ -84,4 +84,4 @@ function queueDirectories(directory) {
8484

8585
// Move out of the directory
8686
cd('..');
87-
}
87+
}

0 commit comments

Comments
 (0)