Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
etersoft-build-utils
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
korinf
etersoft-build-utils
Commits
f34bf628
Commit
f34bf628
authored
Oct 18, 2017
by
Vitaly Lipatov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
rpmgs: rewrite npm hook
parent
081f7122
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
26 additions
and
7 deletions
+26
-7
rpmgs
bin/rpmgs
+26
-7
No files found.
bin/rpmgs
View file @
f34bf628
...
...
@@ -244,7 +244,8 @@ commit_tarball()
# FIXME:
# use real path for download
#is_gear_sources && CURNAME=
is_gear_sources
&&
fatal
"FIXME: fail with is_gear_sources in commit_tarball"
is_gear_sources
&&
CURNAME
=
$(
get_root_git_dir
)
/
$BASENAME
#fatal "FIXME: fail with is_gear_sources in commit_tarball"
# hack: try detect dir for unpacking
#test -d "$CURNAME" || CURNAME=$(get_root_git_dir)/$(get_tarballname "$spec")
...
...
@@ -289,24 +290,42 @@ update_gear_sources()
# npm install section
local
RGD
=
$(
get_root_git_dir
)
if
[
-d
$RGD
/package
]
&&
[
-s
$RGD
/package/package.json
]
;
then
info
"Detected npm install hook"
#if [ -d $PSM ] ; then
info
"Detected npm install hook, run npm install --production"
# if [ -d $RGD/package ] && [ -s $RGD/package/package.json ] ; then
# info "Detected npm install hook"
# hack: try detect dir for unpacking
test
-d
"
$CURNAME
"
||
CURNAME
=
$(
get_tarballname
"
$spec
"
)
test
-d
"
$CURNAME
"
||
CURNAME
=
$BASENAME
#test -d "$CURNAME" || CURNAME=$(get_tarballname "$spec")
#test -d "$CURNAME" || CURNAME=$BASENAME
# see in commit_tarball also
CURNAME
=
$BASENAME
# TODO: add support for git
rm
-rf
$PSM
cp
-a
$RGD
/
$CURNAME
$PSM
||
fatal
cd
$PSM
||
fatal
# CHECKME: drop postinstall due run dev scripts during install --production
# replace with fake commands?
if
[
-s
$RGD
/.gear/npm-preinstall-hook
]
;
then
sh
$RGD
/.gear/npm-preinstall-hook
fi
#subst "s|.*postinstall.*||g" package.json
#a= npm install --production || fatal
a
=
npm
install
||
fatal
# drop all exclude node_modules
# TODO: correct .* removing
rm
-rf
$(
ls
-1
|
grep
-v
node_modules
)
.
*
#epm assure jq || fatal
#(cd node_modules && rm -rf $(jq -r -c '.devDependencies | keys[]' ../package.json))
cd
-
>
/dev/null
docmd git add
-f
$PSM
docmd git commit
$PSM
-m
"update
source
with npm install for
$VERSION
"
fi
docmd git commit
$PSM
-m
"update
node_modules
with npm install for
$VERSION
"
#+
fi
}
parse_cmd_pre_spec
"
$@
"
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment