Skip to content
This repository was archived by the owner on Jun 5, 2020. It is now read-only.

Commit cc6c7ed

Browse files
committed
Get rid of sleep()
1 parent a930ed2 commit cc6c7ed

File tree

3 files changed

+33
-30
lines changed

3 files changed

+33
-30
lines changed

bin/ccjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
*/
1717

1818
/**
19-
* ClosureCompiler.js: ccjs Command Line Utility (c) 2013 Daniel Wirtz <[email protected]>
19+
* ClossureCompiler.js: ccjs Command Line Utility (c) 2013 Daniel Wirtz <[email protected]>
2020
* Released under the Apache License, Version 2.0
2121
* see: https://github.com/dcodeIO/ClosureCompiler.js for details
2222
*/

package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "closurecompiler",
3-
"version": "1.2.0",
3+
"version": "1.3.0",
44
"description": "ClosureCompiler.js: Closure Compiler for node.js. The all-round carefree package.",
55
"author": "Daniel Wirtz <[email protected]>",
66
"contributors": [
@@ -20,7 +20,6 @@
2020
"keywords": ["closure compiler", "closure", "compiler", "util", "utility"],
2121
"dependencies": {
2222
"tar": "*",
23-
"sleep": "*",
2423
"closurecompiler-externs": "*"
2524
},
2625
"license": "Apache License, Version 2.0",

scripts/configure.js

Lines changed: 31 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -65,19 +65,21 @@ download(ccUrl, ccTempFile, function(error, bytes) {
6565
fail();
6666
}
6767
console.log(" ✔ Download complete: "+ccTempFile+" ("+parseInt(bytes/mb, 10)+" mb)\n");
68-
require("sleep").sleep(1);
69-
console.log(" Unpacking "+ccTempFile+" ...");
70-
unpack(ccTempFile, function(error) {
71-
if (error) {
72-
console.log(" ✖ Unpack failed: "+error+"\n");
73-
fail();
74-
}
75-
require("sleep").sleep(1); // Let the entry callbacks finish
76-
console.log(" ✔ Unpack complete.\n");
77-
configure_jre();
78-
}, function(entry) {
79-
console.log(" | "+entry["path"]);
80-
});
68+
setTimeout(function() {
69+
console.log(" Unpacking "+ccTempFile+" ...");
70+
unpack(ccTempFile, function(error) {
71+
if (error) {
72+
console.log(" ✖ Unpack failed: "+error+"\n");
73+
fail();
74+
}
75+
setTimeout(function() { // Let the entry callbacks finish
76+
console.log(" ✔ Unpack complete.\n");
77+
configure_jre();
78+
}, 1000);
79+
}, function(entry) {
80+
console.log(" | "+entry["path"]);
81+
});
82+
}, 1000);
8183
}, function(bytes, total) {
8284
currentBytes += bytes;
8385
if (currentBytes == bytes || currentBytes - lastBytes >= mb) {
@@ -114,20 +116,22 @@ function configure_jre() {
114116
fail();
115117
}
116118
console.log(" ✔ Download complete: "+jreTempFile+" ("+parseInt(bytes/mb, 10)+" mb)\n");
117-
require("sleep").sleep(1);
118-
console.log(" Unpacking "+jreTempFile+" ...");
119-
unpack(jreTempFile, function(error) {
120-
if (error) {
121-
console.log(" ✖ Unpack failed: "+error+"\n");
122-
fail();
123-
}
124-
require("sleep").sleep(1); // Let the entry callbacks finish
125-
console.log(" ✔ Unpack complete.\n");
126-
configure();
127-
runTest(true);
128-
}, function(entry) {
129-
console.log(" | "+entry["path"]);
130-
});
119+
setTimeout(function() {
120+
console.log(" Unpacking "+jreTempFile+" ...");
121+
unpack(jreTempFile, function(error) {
122+
if (error) {
123+
console.log(" ✖ Unpack failed: "+error+"\n");
124+
fail();
125+
}
126+
setTimeout(function() { // Let the entry callbacks finish
127+
console.log(" ✔ Unpack complete.\n");
128+
configure();
129+
runTest(true);
130+
}, 1000);
131+
}, function(entry) {
132+
console.log(" | "+entry["path"]);
133+
});
134+
}, 1000);
131135
}, function(bytes, total) {
132136
currentBytes += bytes;
133137
if (currentBytes == bytes || currentBytes - lastBytes >= mb) {

0 commit comments

Comments
 (0)