CLI for downloading and taking my courses.
Written in Deno.
To get started, run the install script which will download the project into a directory called jp-courses
:
curl -fsSL https://raw.githubusercontent.com/jsjoeio/jp-courses/main/scripts/install.sh | sh
cd jp-courses
./jp-courses --help
- Go to Releases
- Download for your OS (aarch64-apple-darwin is for macOS with M1)
- Unzip
chmod +x jp-courses
- Run
--help
or--dryRun
to get started
After downloading the CLI, you can try the demo course by following these steps:
# inside jp-courses folder
./jp-courses --paymentId cs_live_a1VHFUz7lYnXOL3PUus13VbktedDQDubwfew8E70EvnS1BTOfNTSUXqO0i
# Downloads demo course into folder called `course`
cd course
# Start course
../jp-courses start
# Open course in browser on localhost:4507
This CLI uses the following permissions:
--allow-net
: allow network access- the CLI sends a request to joeprevite.com to verify your purchase, then it downloads the course zip file from raw.githubusercontent.com. We also serve the course content on localhost:4507, or localhpst:$PORT if you specify the
PORT
environment variable.
- the CLI sends a request to joeprevite.com to verify your purchase, then it downloads the course zip file from raw.githubusercontent.com. We also serve the course content on localhost:4507, or localhpst:$PORT if you specify the
--allow-write
- We unzip the course to your current directory (where you call the CLI).
--allow-read
: allow file system read access- Once we've downloaded the course as a zip to the system, we then need this to read the file and unzip it. We also need it to serve the course files on the course server which runs on localhost:4507
--allow-env
- When the CLI is used in dry run mode, we add an environment variable called
DRY_RUN
and set it to "0".
- When the CLI is used in dry run mode, we add an environment variable called
--unstable
- The CLI uses unstable Deno features so we must use this.
Read more about Deno's permissions list here.
This project uses denon
to manage scripts. See scripts.json
Starts the course on http://localhost:3000. Note: this will fail if there is not a directory with /content
at the root.
Runs the script with a valid payment ID to download the course.
Runs the script with the --help
flag.
Runs all the tests.
denon test
Runs only the tests/unit.test.ts
Runs only the tests/integration.test.ts
Runs only the tests/e2e.test.ts
To generate a new release, follow these steps:
- Bump version in
scripts.json
- Commit and push to remote
- Run
denon release
- Type in release notes
- Press Enter