diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a44b572..223c85d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -41,8 +41,6 @@ jobs: - uses: actions/checkout@v4 - name: Install run: npm ci - - name: buildReadme - run: npm run buildReadme - name: Lint run: npm run lint diff --git a/README.md b/README.md index 8812d5b..c9a8457 100644 --- a/README.md +++ b/README.md @@ -17,45 +17,96 @@ See an Asciinema video of usage (including with [fzf](https://github.com/junegun

+ + +## Usage: + +``` +ghe [options] +``` + +## Arguments: + +### paths + +One or more paths to download. Can be a whole +repo, a folder or a file. Supports globs. +To exclude use a negative glob ("!" at the beginning). +Can mix paths from different repos (conflicts resolved +left to right). A trailing slash means a whole folder. + + +## Options: + +### -l, --list + +List files. Useful as a dry run and with fzf. Does not +download. Will show show conflicts for the current +working directory if -d / --dest is not specified. + +### -c, --conflicts-only + +Only show conflicts when listing. + +### -d, --dest + +Destination folder. Defaults to the current directory. + +### -i, --case-insensitive + +Ignores case when checking for conflicts. Default is +case-sensitive--i.e. casing matters. + +### -k, --keep-if + +"newer" | "existing". Will keep conflicting files +if they exist or are newer. WARNING: The +default is to overwrite existing silently. + +### -q, --quiet + +No success or error messages. + +### --colors + +Use ansi escape characters to color output. +Default true but respects the NO_COLOR env var if set. + +## Downloading Examples: + +Entire repo: +```bash +ghe facebook/react +``` +Specific folder: +```bash +ghe facebook/react/packages/* +``` +Specify destination: +```bash +ghe -d local/dest facebook/react +``` +Specific files +```bash +ghe facebook/react/.circleci/config.yml facebook/react/.github/stale.yml +``` +Different repos mixed together" +```bash +ghe facebook/react micromatch/picomatch +``` + + +### Listing Examples: + +Only conflicts +```bash +ghe -lc -d local/dest facebook/react +``` +Specific folder +```bash +ghe -l facebook/react/.circleci/* +``` + + - - -``` - - Usage: ghe [options] - - Arguments: - paths One or more paths to download. Can be a whole - repo, a folder or a file. Supports globs. - To exclude use a negative glob ("!" at the beginning). - Can mix paths from different repos (conflicts resolved - left to right). A trailing slash means a whole folder. - Options: - -l, --list List files. Useful as a dry run and with fzf. Does not - download. Will show show conflicts for the current - working directory if -d / --dest is not specified. - -c, --conflicts-only Only show conflicts when listing. - -d, --dest Destination folder. Defaults to the current directory. - -i, --case-insensitive Ignores case when checking for conflicts. Default is - case-sensitive--i.e. casing matters. - -k, --keep-if "newer" | "existing". Will keep conflicting files - if they exist or are newer. WARNING: The - default is to overwrite existing silently. - -q, --quiet No success or error messages. - --colors Use ansi escape characters to color output. - Default true but respects the NO_COLOR env var if set. - - Download Examples: - Entire repo ghe facebook/react - Specific folder ghe facebook/react/packages/* - Specify destination ghe -d local/dest facebook/react - Specific files ghe facebook/react/.circleci/config.yml facebook/react/.github/stale.yml - Different repos mixed ghe facebook/react micromatch/picomatch - - List Examples: - Only conflicts ghe -lc -d local/dest facebook/react - Specific folder ghe -l facebook/react/.circleci/* - - For a video demo of usage see: https://bn-l.github.io/GithubExtractor/cli/ - -``` \ No newline at end of file + \ No newline at end of file diff --git a/scripts/readme-helper.mts b/scripts/readme-helper.mts index 5608aa9..8d904c5 100644 --- a/scripts/readme-helper.mts +++ b/scripts/readme-helper.mts @@ -7,7 +7,7 @@ const readmePath = "./README.md"; const plainHelp = stripAnsi(helpText) -const readmeAppendix = "```\n" + plainHelp + "\n```"; +const readmeAppendix = "\n" + plainHelp + "\n"; const readme = fs.readFileSync(readmePath, { encoding: "utf8" }); const readmeSnip = readme.split("")[0]; diff --git a/source/index.mts b/source/index.mts index f6a8723..af666bc 100644 --- a/source/index.mts +++ b/source/index.mts @@ -11,6 +11,7 @@ import wrapAnsi from "wrap-ansi"; // name // Todo: +// - Manually do readme from heap text (but can still use script to insert new text to be hand formatted.) // - Add to docs website under "CLI". Import github readme file in