From aa6c9a906f521b8d19daa93242d9fb81ab8069ec Mon Sep 17 00:00:00 2001 From: Romain Date: Mon, 4 Dec 2023 20:24:33 +0000 Subject: [PATCH] chore: update README CLI usage without old dependency --- README.md | 8 +-- package-lock.json | 126 --------------------------------------- package.json | 1 - scripts/readme | 11 ---- scripts/update-readme.js | 11 ++++ 5 files changed, 14 insertions(+), 143 deletions(-) delete mode 100755 scripts/readme create mode 100644 scripts/update-readme.js diff --git a/README.md b/README.md index fbedcfc..b5cb0af 100644 --- a/README.md +++ b/README.md @@ -73,10 +73,9 @@ docker run -v `pwd`:/work thumbsupgallery/thumbsup [...] This reflects the CLI for the latest code on `master`. For the latest published version please refer to the [docs on the website](https://thumbsup.github.io). - + ``` - Usages: thumbsup [required] [options] thumbsup --config config.json @@ -161,7 +160,7 @@ Deprecated: --download-photos Target of the photo download links [choices: "large", "copy", "symlink", "link"] --download-videos Target of the video download links [choices: "large", "copy", "symlink", "link"] --download-link-prefix Path or URL prefix for linked downloads [string] - --usage-stats Enable anonymous usage statistics [boolean] [default: false] + --usage-stats Enable anonymous usage statistics [boolean] Options: --version Show version number [boolean] @@ -172,8 +171,7 @@ Options: per argument, not including the leading "--". For example: { "sort-albums-by": "start-date" } ``` - - + ## Contributing diff --git a/package-lock.json b/package-lock.json index 33e951a..baa1ee2 100644 --- a/package-lock.json +++ b/package-lock.json @@ -46,7 +46,6 @@ "c8": "^8.0.1", "glob": "^10.3.10", "gm": "^1.25.0", - "injectmd": "^1.0.0", "markdown-toc": "^1.2.0", "mocha": "^10.2.0", "mock-fs": "^5.2.0", @@ -1225,12 +1224,6 @@ "node": ">=0.10.0" } }, - "node_modules/cliclopts": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/cliclopts/-/cliclopts-1.1.1.tgz", - "integrity": "sha1-aUMcfLWvcjd0sNORG0w3USQxkQ8=", - "dev": true - }, "node_modules/cliui": { "version": "7.0.4", "resolved": "https://registry.npmjs.org/cliui/-/cliui-7.0.4.tgz", @@ -3120,43 +3113,6 @@ "node": "^14.17.0 || ^16.13.0 || >=18.0.0" } }, - "node_modules/injectmd": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/injectmd/-/injectmd-1.0.0.tgz", - "integrity": "sha1-22AYCqVgLYA/mv7BozBSKD52iy8=", - "dev": true, - "dependencies": { - "bl": "^1.1.2", - "cliclopts": "^1.1.1", - "minimist": "^1.2.0", - "pump": "^1.0.1", - "readable-stream": "^2.0.5", - "split2": "^2.0.1" - }, - "bin": { - "node-injectmd": "bin/cli.js" - } - }, - "node_modules/injectmd/node_modules/bl": { - "version": "1.2.3", - "resolved": "https://registry.npmjs.org/bl/-/bl-1.2.3.tgz", - "integrity": "sha512-pvcNpa0UU69UT341rO6AYy4FVAIkUHuZXRIWbq+zHnsVcRzDDjIAhGuuYoi0d//cwIwtt4pkpKycWEfjdV+vww==", - "dev": true, - "dependencies": { - "readable-stream": "^2.3.5", - "safe-buffer": "^5.1.1" - } - }, - "node_modules/injectmd/node_modules/pump": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/pump/-/pump-1.0.3.tgz", - "integrity": "sha512-8k0JupWme55+9tCVE+FS5ULT3K6AbgqrGa58lTT49RpyfwwcGedHqaC5LlQNdEAumn/wFsu6aPwkuPMioy8kqw==", - "dev": true, - "dependencies": { - "end-of-stream": "^1.1.0", - "once": "^1.3.1" - } - }, "node_modules/internal-slot": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/internal-slot/-/internal-slot-1.0.5.tgz", @@ -5988,25 +5944,6 @@ "node": "*" } }, - "node_modules/split2": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/split2/-/split2-2.2.0.tgz", - "integrity": "sha512-RAb22TG39LhI31MbreBgIuKiIKhVsawfTgEGqKHTK87aG+ul/PB8Sqoi3I7kVdRWiCfrKxK3uo4/YUkpNvhPbw==", - "dev": true, - "dependencies": { - "through2": "^2.0.2" - } - }, - "node_modules/split2/node_modules/through2": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/through2/-/through2-2.0.5.tgz", - "integrity": "sha512-/mrRod8xqpA+IHSLyGCQ2s8SPHiCDEeQJSep1jqLYeEUClOFG2Qsh+4FU6G9VeqpZnGW/Su8LQGc4YKni5rYSQ==", - "dev": true, - "dependencies": { - "readable-stream": "~2.3.6", - "xtend": "~4.0.1" - } - }, "node_modules/sprintf-js": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", @@ -7978,12 +7915,6 @@ "string-width": "^1.0.1" } }, - "cliclopts": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/cliclopts/-/cliclopts-1.1.1.tgz", - "integrity": "sha1-aUMcfLWvcjd0sNORG0w3USQxkQ8=", - "dev": true - }, "cliui": { "version": "7.0.4", "resolved": "https://registry.npmjs.org/cliui/-/cliui-7.0.4.tgz", @@ -9380,42 +9311,6 @@ "resolved": "https://registry.npmjs.org/ini/-/ini-4.1.1.tgz", "integrity": "sha512-QQnnxNyfvmHFIsj7gkPcYymR8Jdw/o7mp5ZFihxn6h8Ci6fh3Dx4E1gPjpQEpIuPo9XVNY/ZUwh4BPMjGyL01g==" }, - "injectmd": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/injectmd/-/injectmd-1.0.0.tgz", - "integrity": "sha1-22AYCqVgLYA/mv7BozBSKD52iy8=", - "dev": true, - "requires": { - "bl": "^1.1.2", - "cliclopts": "^1.1.1", - "minimist": "^1.2.0", - "pump": "^1.0.1", - "readable-stream": "^2.0.5", - "split2": "^2.0.1" - }, - "dependencies": { - "bl": { - "version": "1.2.3", - "resolved": "https://registry.npmjs.org/bl/-/bl-1.2.3.tgz", - "integrity": "sha512-pvcNpa0UU69UT341rO6AYy4FVAIkUHuZXRIWbq+zHnsVcRzDDjIAhGuuYoi0d//cwIwtt4pkpKycWEfjdV+vww==", - "dev": true, - "requires": { - "readable-stream": "^2.3.5", - "safe-buffer": "^5.1.1" - } - }, - "pump": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/pump/-/pump-1.0.3.tgz", - "integrity": "sha512-8k0JupWme55+9tCVE+FS5ULT3K6AbgqrGa58lTT49RpyfwwcGedHqaC5LlQNdEAumn/wFsu6aPwkuPMioy8kqw==", - "dev": true, - "requires": { - "end-of-stream": "^1.1.0", - "once": "^1.3.1" - } - } - } - }, "internal-slot": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/internal-slot/-/internal-slot-1.0.5.tgz", @@ -11549,27 +11444,6 @@ "through": "2" } }, - "split2": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/split2/-/split2-2.2.0.tgz", - "integrity": "sha512-RAb22TG39LhI31MbreBgIuKiIKhVsawfTgEGqKHTK87aG+ul/PB8Sqoi3I7kVdRWiCfrKxK3uo4/YUkpNvhPbw==", - "dev": true, - "requires": { - "through2": "^2.0.2" - }, - "dependencies": { - "through2": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/through2/-/through2-2.0.5.tgz", - "integrity": "sha512-/mrRod8xqpA+IHSLyGCQ2s8SPHiCDEeQJSep1jqLYeEUClOFG2Qsh+4FU6G9VeqpZnGW/Su8LQGc4YKni5rYSQ==", - "dev": true, - "requires": { - "readable-stream": "~2.3.6", - "xtend": "~4.0.1" - } - } - } - }, "sprintf-js": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", diff --git a/package.json b/package.json index 86a0c7f..2a831b4 100644 --- a/package.json +++ b/package.json @@ -66,7 +66,6 @@ "c8": "^8.0.1", "glob": "^10.3.10", "gm": "^1.25.0", - "injectmd": "^1.0.0", "markdown-toc": "^1.2.0", "mocha": "^10.2.0", "mock-fs": "^5.2.0", diff --git a/scripts/readme b/scripts/readme deleted file mode 100755 index 9b8f449..0000000 --- a/scripts/readme +++ /dev/null @@ -1,11 +0,0 @@ -#!/bin/bash -e - -PATH=$PATH:./node_modules/.bin - -function cli { - echo "\`\`\`" - node bin/thumbsup.js --help - echo "\`\`\`" -} - -echo "$(cli)" | node-injectmd -t cli -i README.md diff --git a/scripts/update-readme.js b/scripts/update-readme.js new file mode 100644 index 0000000..5b47607 --- /dev/null +++ b/scripts/update-readme.js @@ -0,0 +1,11 @@ +const fs = require('node:fs') +const child = require('node:child_process') + +// get latest CLI help text +const output = child.execSync('node bin/thumbsup.js --help') +const codeblock = '```' + output + '```' + +// update README file +const readme = fs.readFileSync('README.md', 'utf-8') +const updated = readme.replace(/[\s\S]*?/, `\n${codeblock}\n`) +fs.writeFileSync('README.md', updated)