Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/npm/cli.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorisaacs <i@izs.me>2012-01-06 12:19:46 +0400
committerisaacs <i@izs.me>2012-01-06 12:19:46 +0400
commit7693710e296268655333b845f26e6f874039d821 (patch)
tree58fd71c9caace647f0e7cb162369c25b54498bba /scripts
parente314b93701b3997df7e20069fca0be37b46429e5 (diff)
Get the 'building ronn' lock pid less cleverly
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/doc-build.sh10
1 files changed, 8 insertions, 2 deletions
diff --git a/scripts/doc-build.sh b/scripts/doc-build.sh
index d1ece59f6..8fbd42453 100755
--- a/scripts/doc-build.sh
+++ b/scripts/doc-build.sh
@@ -7,7 +7,13 @@ set -o errexit
set -o pipefail
if ! [ -x node_modules/.bin/ronn ]; then
- if [ -f .building_ronn -a $(ps --no-headers -p $(cat .building_ronn) 2> /dev/null | wc -l) != 0 ]; then
+ ps=0
+ if [ -f .building_ronn ]; then
+ pid=$(cat .building_ronn)
+ ps=$(ps -p $pid | grep $pid | wc -l) || true
+ fi
+
+ if [ -f .building_ronn ] && [ $ps != 0 ]; then
while [ -f .building_ronn ]; do
sleep 1
done
@@ -68,4 +74,4 @@ case $dest in
echo "Invalid destination type: $dest" >&2
exit 1
;;
-esac \ No newline at end of file
+esac