diff --git a/tools/cli/commands.js b/tools/cli/commands.js index 7bf3068b31..bdfce1d613 100644 --- a/tools/cli/commands.js +++ b/tools/cli/commands.js @@ -47,8 +47,8 @@ const runCommand = async (command) => { }) } /** - * - * @param {Promise<() => T>} fn + * + * @param {Promise<() => T>} fn * @returns {Promise<[T, null]> | Promise<[null, Error]>} */ const tryRun = async (fn) => { @@ -56,10 +56,10 @@ const tryRun = async (fn) => { } /** - * - * @param {string} bash command + * + * @param {string} bash command * @param {[string, null] | [null, Error]}} Result or Error - * @returns + * @returns */ const bash = (text, ...values) => @@ -564,7 +564,7 @@ main.registerCommand({ * @typedef {Object.} Skeletons */ /** - * Resolves into json with + * Resolves into json with * @returns {Promise<[Skeletons, null]> | Promise<[null, Error]>} */ function getExamplesJSON(){ @@ -930,7 +930,7 @@ main.registerCommand({ // do next. Console.info("To run your new app:"); - + if (appPathAsEntered !== ".") { // Wrap the app path in quotes if it contains spaces @@ -1004,7 +1004,7 @@ main.registerCommand({ if (options.from) { await setupExampleByURL(options.from); - return 0; + return 0; } var toIgnore = [/^local$/, /^\.id$/]; @@ -1020,19 +1020,27 @@ main.registerCommand({ const skeleton = skeletonExplicitOption || DEFAULT_SKELETON; try { - // Prototype option should use local skeleton. + // Prototype option should use local skeleton. // Maybe we should use a different skeleton for prototype if (options.prototype) throw new Error("Using prototype option"); + // if using the release option we should use the default skeleton + // using it as it was before 2.x + if (release.explicit) throw new Error("Using release option"); await setupExampleByURL(`https://github.com/meteor/skel-${skeleton}`); } catch (e) { - - if (e.message !== "Using prototype option") { + + if ( + e.message !== "Using prototype option" || + e.message !== "Using release option" + ) { // something has happened while creating the app using git clone Console.error( `Something has happened while creating your app using git clone. Will use cached version of skeletons. - Error message: `, e.message); + Error message: `, + e.message + ); } // TODO: decide if this should stay here or not. @@ -1054,7 +1062,7 @@ main.registerCommand({ const prototypePackages = () => "autopublish # Publish all data to the clients (for prototyping)\n" + "insecure # Allow all DB writes from clients (for prototyping)"; - + // XXX: if there is the need to add more options maybe we should have a better abstraction for this if-else if (options.prototype) { return Buffer.from(