Simplify the process by just assuming my own git.

master
Zed A. Shaw 1 year ago
parent 82813aec03
commit ebdcf509fb
  1. 12
      README.md
  2. 13
      commands/create.js
  3. 2
      package.json

@ -1,4 +1,4 @@
# LJSTHW Bandolier ## LJSTHW Bandolier
The Bandolier is an educational web framework featured in the [Learn JavaScript the Hard Way](https://learnjsthehardway.com) course. The Bandolier contains all of the features a full stack developer would need to learn, but with smaller easier to understand implementations that are fully visible in the project. The Bandolier is an educational web framework featured in the [Learn JavaScript the Hard Way](https://learnjsthehardway.com) course. The Bandolier contains all of the features a full stack developer would need to learn, but with smaller easier to understand implementations that are fully visible in the project.
@ -70,6 +70,16 @@ npx bando-up create my-first-project
This will create an initial web application using the course's web framework named `Bandolier`. It checks out the project from the `git.learnjsthehardway.com` site and then configures it so you get started. This will create an initial web application using the course's web framework named `Bandolier`. It checks out the project from the `git.learnjsthehardway.com` site and then configures it so you get started.
### Installing Other Projects
Since this tool is intended to make it easier for [Learn JavaScript the Hard Way](https://learnjsthehardway.com) student it only select projects from git.learnjsthehardway.com using their names. You use the `--using` option to specify a different project:
```shell
npx bando-up --using js-level-1-code my-js-level-1
```
This will check out the full URL `https://git.learnjsthehardway.com/learn-javascript-the-hard-way/bandolier-template.git` using `git` and then do the usual setup. You an [view a list of all available code](https://learnjsthehardway.com) for the course.
## Updating ## Updating
When there's new releases you can update with: When there's new releases you can update with:

@ -3,26 +3,31 @@ import { mkdir_to, exec_i, copy, glob } from "../lib/builderator.js";
import { log } from "../lib/logging.js"; import { log } from "../lib/logging.js";
import path from "path"; import path from "path";
export const BANDO_GIT = "https://git.learnjsthehardway.com/learn-javascript-the-hard-way/bandolier-template.git"; export const GIT_BASE = "https://git.learnjsthehardway.com/learn-javascript-the-hard-way/";
export const BANDO_GIT = "bandolier-template";
export const description = "Generates projects using the Bandolier educational framework."; export const description = "Generates projects using the Bandolier educational framework.";
export const options = [ export const options = [
["--repo", "repository to dupe and setup", BANDO_GIT], ["--using <name>", "repository to dupe and setup", BANDO_GIT],
["--template", "templates directory to use for setups", "commands/templates"], ["--template <dir>", "templates directory to use for setups", "commands/templates"],
["--keep-git", "for patches and analysis, you can keep the original .git", false], ["--keep-git", "for patches and analysis, you can keep the original .git", false],
]; ];
export const argument = ["<target>", "name of the project directory (must not exist)"]; export const argument = ["<target>", "name of the project directory (must not exist)"];
export const main = async (target, opts) => { export const main = async (target, opts) => {
const git_url = `${GIT_BASE}${BANDO_GIT}.git`;
log.info(`Cloning from ${git_url}`);
try { try {
await fs.access(target); await fs.access(target);
log.error(`Target ${target} exists. Won't install into it.`); log.error(`Target ${target} exists. Won't install into it.`);
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}`); exec_i(`git clone --depth 1 ${git_url} ${target}`);
} }
// normalize the temp directory // normalize the temp directory

@ -1,6 +1,6 @@
{ {
"name": "ljsthw-bandolier", "name": "ljsthw-bandolier",
"version": "0.3.1", "version": "0.4.1",
"description": "Generates projects using the Bandolier educational framework.", "description": "Generates projects using the Bandolier educational framework.",
"main": "bando.js", "main": "bando.js",
"bin": { "bin": {

Loading…
Cancel
Save