Skip to content

Commit 4a82187

Browse files
build(npm): automatically run build-icons for correct os (#2360)
1 parent 5921537 commit 4a82187

File tree

3 files changed

+27
-9
lines changed

3 files changed

+27
-9
lines changed

README.md

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -269,10 +269,10 @@ https://www.python.org/downloads/
269269
> **Note**
270270
> Make sure your Python install includes [pip](https://pypi.org/project/pip/)
271271
272-
<h3>Install Selenium</h3>
272+
<h3>Install Dependencies</h3>
273273

274274
```bash
275-
python3 -m pip install --upgrade pip && pip install selenium==4.1.0 requests==2.25.1
275+
python -m pip install -r ./.github/scripts/requirements.txt
276276
```
277277

278278
<h3 id="building-icons">Build the new icons</h3>
@@ -281,11 +281,7 @@ python3 -m pip install --upgrade pip && pip install selenium==4.1.0 requests==2.
281281
Usually, this is done on each release, but you can have a sneak peek before a release.</p>
282282

283283
```bash
284-
# Linux/Unix
285284
npm run build-icons
286-
287-
# Windows
288-
python3 ./.github/scripts/icomoon_build_githubless.py ./.github/scripts/build_assets/geckodriver-v0.32.2-win64/geckodriver.exe ./icomoon.json ./devicon.json ./icons ./ --headless
289285
```
290286

291287
<i>The process might take a while, depending on your operating system's speed and the amount of icons.</i>
@@ -311,7 +307,7 @@ npm run dev # Will run on port 8000
311307
<p>Or this command, which does exactly the same, but the port can be customized.</p>
312308

313309
```bash
314-
python3 -m http.server <port>
310+
python -m http.server <port>
315311
```
316312

317313
<p>You're done now! :tada: Your build of Devicons should be available at <code>https://localhost:8000</code> (or the desired port).</p>

package-lock.json

Lines changed: 18 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,12 @@
88
"peek-test": "python ./.github/scripts/icomoon_peek.py ./.github/scripts/build_assets/geckodriver-v0.32.2-linux64/geckodriver ./icomoon.json ./devicon.json ./icons ./ --pr_title \"$PR_TITLE\"",
99
"optimize-svg": "gulp optimizeSvg",
1010
"bump": "gulp bumpVersion",
11-
"build-icons": "python3 ./.github/scripts/icomoon_build_githubless.py ./.github/scripts/build_assets/geckodriver-v0.32.2-linux64/geckodriver ./icomoon.json ./devicon.json ./icons ./ --headless",
11+
"build-icons": "run-script-os",
12+
"build-icons:linux:macOS": "python ./.github/scripts/icomoon_build_githubless.py ./.github/scripts/build_assets/geckodriver-v0.32.2-linux64/geckodriver ./icomoon.json ./devicon.json ./icons ./ --headless",
13+
"build-icons:windows": "python ./.github/scripts/icomoon_build_githubless.py ./.github/scripts/build_assets/geckodriver-v0.32.2-win64/geckodriver.exe ./icomoon.json ./devicon.json ./icons ./ --headless",
14+
"build-icons:default": "echo 'Unsupported OS' && exit 1",
1215
"dev": "concurrently \"npm:open-browser\" \"npm:start-local-server\"",
13-
"start-local-server": "python3 -m http.server 8000",
16+
"start-local-server": "python -m http.server 8000",
1417
"open-browser": "node -e \"import('open').then(pkg => pkg.default('http://localhost:8000/docs'))\""
1518
},
1619
"repository": {
@@ -36,6 +39,7 @@
3639
"gulp-sass": "^5.0.0",
3740
"gulp-svgmin": "^3.0.0",
3841
"open": "^10.0.3",
42+
"run-script-os": "^1.1.6",
3943
"sass": "^1.26.10",
4044
"yargs": "^17.0.0"
4145
}

0 commit comments

Comments
 (0)