-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use yarn to install dependencies if yarn.lock is available (#32)
* Add check for yarn.lock and use yarn to install if available * Add check for yarn executable * Bump version * Fix init script, add postinstall * Fix shellcheck issues * Tweak postinstall script * Tweak postinstall script * Remove postinstall
- Loading branch information
Showing
2 changed files
with
15 additions
and
3 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,14 @@ | ||
PKG=eslint-config-airbnb; | ||
npm info "$PKG@latest" peerDependencies --json | command sed 's/[\{\},]//g ; s/: /@/g' | xargs npm install --save-dev "$PKG@latest" | ||
#!/bin/bash | ||
|
||
PKG=eslint-config-airbnb | ||
|
||
# Default to installing using npm | ||
INSTALL="npm install --save-dev" | ||
|
||
# Is this a yarn project and yarn is found in PATH, then install using yarn | ||
if [[ -f $(PWD)/yarn.lock && -x $(which yarn) ]] | ||
then | ||
INSTALL="yarn add --dev" | ||
fi | ||
|
||
npm info "$PKG@latest" peerDependencies --json | command sed 's/[\{\},]//g ; s/: /@/g' | xargs $INSTALL "$PKG@latest" |
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