From fc36b15fc2f5f47fb998ade000680e0b71519437 Mon Sep 17 00:00:00 2001 From: Jeroen Engels Date: Fri, 12 Mar 2021 17:43:28 +0100 Subject: [PATCH] Add script to npm scripts, and explain how to run --- create-dependency/index.js | 16 +++++++++++++++- package.json | 1 + 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/create-dependency/index.js b/create-dependency/index.js index 705b39e2..57452dd7 100644 --- a/create-dependency/index.js +++ b/create-dependency/index.js @@ -1,3 +1,12 @@ +/* To run this script: + + npm run generate-dep -- + +Example: + + npm run generate-dep -- elm/url +*/ + const path = require('path'); const https = require('https'); const fs = require('fs').promises; @@ -29,8 +38,13 @@ const packageName = process.argv[2]; if (!packageName) { console.error(`Need to pass in a package name. For instance: - node create-dependency.js elm/html + npm run generate-dep -- + +Example: + + npm run generate-dep -- elm/url `) + process.exit(1); } async function downloadFiles() { diff --git a/package.json b/package.json index b636404d..e9742f3d 100644 --- a/package.json +++ b/package.json @@ -5,6 +5,7 @@ "test": "elm make --docs=docs.json && elm-format src/ --validate && elm-test && npm run phantom-tests && elm-review", "phantom-tests": "node phantom-type-tests/run.js", "backport-rules": "cp -r ../elm-review-{common,debug,documentation,the-elm-architecture,unused,simplification,imports,noredundantconcat}/{src,tests}/* tests", + "generate-dep": "node create-dependency", "postinstall": "elm-tooling install" }, "dependencies": {