diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..5ab9157 --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +# Don't track the Node.js installation artifacts +/node_modules/ +/package-lock.json diff --git a/README.md b/README.md index 9e74943..a4b5969 100644 --- a/README.md +++ b/README.md @@ -56,13 +56,19 @@ npm install --save https://github.com/HatScripts/circle-flags ## Contributing To contribute, you need to have the latest version of [svgo](https://github.com/svg/svgo) installed. +You can run the following command to install it in the circle-flags project directory: + +```sh +npm install +``` First, edit the relevant SVG files in the `flags/` directory. -Then run `svgo` to optimize the SVG files: +Then run the `svgo` wrapper script (defined in the scripts section of [package.json](./package.json)), +which uses the locally-installed `svgo` executable to optimize the SVG files: ```sh -svgo ./flags --recursive --config=svgo.config.js +npm run svgo ``` Then commit the changes, and submit them as a pull request. diff --git a/package.json b/package.json index 2ac7e91..d0053cf 100644 --- a/package.json +++ b/package.json @@ -33,5 +33,11 @@ "bugs": { "url": "https://github.com/HatScripts/circle-flags/issues" }, - "homepage": "https://github.com/HatScripts/circle-flags#readme" + "homepage": "https://github.com/HatScripts/circle-flags#readme", + "devDependencies": { + "svgo": "^3.0.2" + }, + "scripts": { + "svgo": "node_modules/.bin/svgo ./flags --recursive --config=svgo.config.js" + } }