-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(scripts): move pre start script from package.json to a sh file
- Loading branch information
1 parent
8fa1658
commit c828f2f
Showing
4 changed files
with
24 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
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,14 +1,22 @@ | ||
#!/bin/sh | ||
#!/bin/bash | ||
|
||
# read all dependencies name on package.json | ||
|
||
DEPS="$(cat package.json | grep -A 100 "dependencies" | grep -B 100 "\}\," | \ | ||
awk "NR>1" | sed -e "s/},//" | tr -d '":.^0-9,')"; | ||
|
||
# loop on dependencies names and save each name on a file | ||
|
||
for dep in "$(echo $DEPS)"; do | ||
echo $dep | sed -e 's/ /\n/g' > deps; | ||
done; | ||
|
||
# read each name on saved file and check version on yarn.lock | ||
|
||
while IFS= read -r line; do | ||
yarn list --depth 0 | grep $line@ | ||
done < ./deps; | ||
|
||
# delete file | ||
|
||
rm -rf ./deps |
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,14 +1,22 @@ | ||
#!/bin/sh | ||
#!/bin/bash | ||
|
||
# read all devDependencies name on package.json | ||
|
||
DEV_DEPS="$(cat package.json | grep -A 100 "devDependencies" | grep -B 100 "\}\," | \ | ||
awk "NR>1" | sed -e "s/},//" | tr -d '":.^0-9,')"; | ||
|
||
# loop on dependencies names and save each name on a file | ||
|
||
for dep in "$(echo $DEV_DEPS)"; do | ||
echo $dep | sed -e 's/ /\n/g' > deps; | ||
done; | ||
|
||
# read each name on saved file and check version on yarn.lock | ||
|
||
while IFS= read -r line; do | ||
yarn list --depth 0 | grep $line@ | ||
done < ./deps; | ||
|
||
# delete file | ||
|
||
rm -rf ./deps |
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 |
---|---|---|
@@ -0,0 +1,5 @@ | ||
#!/bin/bash | ||
|
||
# check if some node app is running on port 3000 and kill the process | ||
|
||
lsof -i:3000 | awk '/node/{print $2}' | awk 'NR == 1' | xargs -r kill -9 |