jsrepo 1.7.0 → 1.7.1
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/dist/index.js +4 -4
- package/package.json +1 -1
- package/src/commands/init.ts +6 -6
package/dist/index.js
CHANGED
|
@@ -2340,6 +2340,10 @@ var _initProject = async (options) => {
|
|
|
2340
2340
|
};
|
|
2341
2341
|
var _initRegistry = async (options) => {
|
|
2342
2342
|
const loading = spinner5();
|
|
2343
|
+
const packagePath = path9.join(options.cwd, "package.json");
|
|
2344
|
+
if (!fs9.existsSync(packagePath)) {
|
|
2345
|
+
program5.error(color12.red(`Couldn't find your ${color12.bold("package.json")}!`));
|
|
2346
|
+
}
|
|
2343
2347
|
if (!options.path) {
|
|
2344
2348
|
const response = await text({
|
|
2345
2349
|
message: "Where are your blocks located?",
|
|
@@ -2353,10 +2357,6 @@ var _initRegistry = async (options) => {
|
|
|
2353
2357
|
}
|
|
2354
2358
|
options.path = response;
|
|
2355
2359
|
}
|
|
2356
|
-
const packagePath = path9.join(options.cwd, "package.json");
|
|
2357
|
-
if (!fs9.existsSync(packagePath)) {
|
|
2358
|
-
program5.error(color12.red(`Couldn't find your ${color12.bold("package.json")}!`));
|
|
2359
|
-
}
|
|
2360
2360
|
const pkg = JSON.parse(fs9.readFileSync(packagePath).toString());
|
|
2361
2361
|
const scriptAlreadyExists = pkg.scripts !== void 0 && pkg.scripts[options.script] !== void 0;
|
|
2362
2362
|
if (!options.yes && scriptAlreadyExists) {
|
package/package.json
CHANGED
package/src/commands/init.ts
CHANGED
|
@@ -206,6 +206,12 @@ const _initProject = async (options: Options) => {
|
|
|
206
206
|
const _initRegistry = async (options: Options) => {
|
|
207
207
|
const loading = spinner();
|
|
208
208
|
|
|
209
|
+
const packagePath = path.join(options.cwd, 'package.json');
|
|
210
|
+
|
|
211
|
+
if (!fs.existsSync(packagePath)) {
|
|
212
|
+
program.error(color.red(`Couldn't find your ${color.bold('package.json')}!`));
|
|
213
|
+
}
|
|
214
|
+
|
|
209
215
|
if (!options.path) {
|
|
210
216
|
const response = await text({
|
|
211
217
|
message: 'Where are your blocks located?',
|
|
@@ -222,12 +228,6 @@ const _initRegistry = async (options: Options) => {
|
|
|
222
228
|
options.path = response;
|
|
223
229
|
}
|
|
224
230
|
|
|
225
|
-
const packagePath = path.join(options.cwd, 'package.json');
|
|
226
|
-
|
|
227
|
-
if (!fs.existsSync(packagePath)) {
|
|
228
|
-
program.error(color.red(`Couldn't find your ${color.bold('package.json')}!`));
|
|
229
|
-
}
|
|
230
|
-
|
|
231
231
|
const pkg = JSON.parse(fs.readFileSync(packagePath).toString());
|
|
232
232
|
|
|
233
233
|
const scriptAlreadyExists =
|