-
-
Save monkpit/fd1ee6123902cc934f166775b9285e73 to your computer and use it in GitHub Desktop.
Parallel execution with find and xargs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /usr/bin/env bash | |
find ./src/bookmarklets -name "*.js" -print0 | xargs -I FILE -0 -P "$(nproc)" npm run rollup -- --input "FILE" --file "output/FILE" | |
# EDIT: Per my latest comment - I now prefer this: | |
for bookmarklet in ./src/bookmarklets/**/*.js | |
do | |
npm run rollup -- --input "$bookmarklet" --file "output/$bookmarklet" & | |
done | |
wait |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment