ic-mops 1.7.1 → 1.7.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +3 -0
- package/bundle/cli.js +1184 -0
- package/commands/replica.ts +23 -12
- package/dist/commands/replica.js +20 -11
- package/dist/package.json +1 -1
- package/package.json +1 -1
- package/bundle/cli.tgz +0 -0
package/commands/replica.ts
CHANGED
|
@@ -132,20 +132,31 @@ export class Replica {
|
|
|
132
132
|
async stop(sigint = false) {
|
|
133
133
|
if (this.type === 'dfx' || this.type === 'dfx-pocket-ic') {
|
|
134
134
|
if (this.dfxProcess) {
|
|
135
|
-
this.dfxProcess.kill();
|
|
135
|
+
let killed = this.dfxProcess.kill();
|
|
136
|
+
|
|
137
|
+
if (!killed) {
|
|
138
|
+
this.dfxProcess.kill('SIGKILL');
|
|
139
|
+
}
|
|
140
|
+
|
|
136
141
|
// give replica some time to stop
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
142
|
+
let i = 0;
|
|
143
|
+
while (this.dfxProcess.exitCode === null) {
|
|
144
|
+
i++;
|
|
145
|
+
await new Promise((resolve) => {
|
|
146
|
+
setTimeout(resolve, 500);
|
|
147
|
+
});
|
|
148
|
+
if (i >= 20) {
|
|
149
|
+
break;
|
|
150
|
+
}
|
|
151
|
+
}
|
|
141
152
|
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
153
|
+
// // make sure replica is stopped
|
|
154
|
+
// try {
|
|
155
|
+
// // execSync('dfx killall', {cwd: this.dir, timeout: 3_000, stdio: ['pipe', this.verbose ? 'inherit' : 'ignore', 'pipe']});
|
|
156
|
+
// execSync('dfx stop' + (this.verbose ? '' : ' -qqqq'), {cwd: this.dir, timeout: 3_000, stdio: ['pipe', this.verbose ? 'inherit' : 'ignore', 'pipe']});
|
|
157
|
+
// }
|
|
158
|
+
// catch {}
|
|
159
|
+
}
|
|
149
160
|
}
|
|
150
161
|
else if (this.pocketIc && this.pocketIcServer) {
|
|
151
162
|
if (!sigint) {
|
package/dist/commands/replica.js
CHANGED
|
@@ -103,19 +103,28 @@ export class Replica {
|
|
|
103
103
|
async stop(sigint = false) {
|
|
104
104
|
if (this.type === 'dfx' || this.type === 'dfx-pocket-ic') {
|
|
105
105
|
if (this.dfxProcess) {
|
|
106
|
-
this.dfxProcess.kill();
|
|
106
|
+
let killed = this.dfxProcess.kill();
|
|
107
|
+
if (!killed) {
|
|
108
|
+
this.dfxProcess.kill('SIGKILL');
|
|
109
|
+
}
|
|
107
110
|
// give replica some time to stop
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
+
let i = 0;
|
|
112
|
+
while (this.dfxProcess.exitCode === null) {
|
|
113
|
+
i++;
|
|
114
|
+
await new Promise((resolve) => {
|
|
115
|
+
setTimeout(resolve, 500);
|
|
116
|
+
});
|
|
117
|
+
if (i >= 20) {
|
|
118
|
+
break;
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
// // make sure replica is stopped
|
|
122
|
+
// try {
|
|
123
|
+
// // execSync('dfx killall', {cwd: this.dir, timeout: 3_000, stdio: ['pipe', this.verbose ? 'inherit' : 'ignore', 'pipe']});
|
|
124
|
+
// execSync('dfx stop' + (this.verbose ? '' : ' -qqqq'), {cwd: this.dir, timeout: 3_000, stdio: ['pipe', this.verbose ? 'inherit' : 'ignore', 'pipe']});
|
|
125
|
+
// }
|
|
126
|
+
// catch {}
|
|
111
127
|
}
|
|
112
|
-
// if (!this.dfxProcess) {
|
|
113
|
-
// try {
|
|
114
|
-
// execSync('dfx killall', {cwd: this.dir, timeout: 3_000, stdio: ['pipe', this.verbose ? 'inherit' : 'ignore', 'pipe']});
|
|
115
|
-
// execSync('dfx stop' + (this.verbose ? '' : ' -qqqq'), {cwd: this.dir, timeout: 10_000, stdio: ['pipe', this.verbose ? 'inherit' : 'ignore', 'pipe']});
|
|
116
|
-
// }
|
|
117
|
-
// catch {}
|
|
118
|
-
// }
|
|
119
128
|
}
|
|
120
129
|
else if (this.pocketIc && this.pocketIcServer) {
|
|
121
130
|
if (!sigint) {
|
package/dist/package.json
CHANGED
package/package.json
CHANGED
package/bundle/cli.tgz
DELETED
|
Binary file
|