Apparently, git's clone --templates feature is nothing like what the documentation describes. It _only_ installs files that are on the local machine, rather than from the repository content which is what I'd expect based on the documentation.

master
Zed A. Shaw 2 years ago
parent dde93d5f27
commit f9bed87ffb
  1. 6
      commands/create.js

@ -4,11 +4,11 @@ import { log } from "../lib/logging.js";
export const BANDO_GIT = "https://git.learnjsthehardway.com/learn-javascript-the-hard-way/bandolier-template.git"; export const BANDO_GIT = "https://git.learnjsthehardway.com/learn-javascript-the-hard-way/bandolier-template.git";
export const description = "Test command."; export const description = "Installs demo/template repositories for the Bandolier project of Learn JavaScript the Hard Way.";
export const options = [ export const options = [
["--repo", "repository to dupe and setup", BANDO_GIT], ["--repo", "repository to dupe and setup", BANDO_GIT],
["--template", "templates directory to use for setups", "commands/templates"] ["--template", "templates directory to use for setups", "./commands/templates"]
]; ];
export const argument = ["<target>", "name of the project"]; export const argument = ["<target>", "name of the project"];
@ -23,7 +23,7 @@ export const main = async (target, opts) => {
process.exit(1); process.exit(1);
} catch(error) { } catch(error) {
// access is stupid, it throws an exception but we want the negative response as a positive outcome // access is stupid, it throws an exception but we want the negative response as a positive outcome
exec_i(`git clone --depth 1 ${BANDO_GIT} ${target} --template=${opts.template}`); exec_i(`git clone --depth 1 ${BANDO_GIT} ${target}`);
process.exit(0); process.exit(0);
} }
} }

Loading…
Cancel
Save