Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
freedombone
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Context Sensitive Group
freedombone
Commits
f1ca6f03
Commit
f1ca6f03
authored
6 years ago
by
Bob Mottram
Browse files
Options
Downloads
Patches
Plain Diff
Use upgrade flag to prevent global node modules from being removed
parent
f6becba8
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/freedombone-utils-nodejs
+11
-2
11 additions, 2 deletions
src/freedombone-utils-nodejs
with
11 additions
and
2 deletions
src/freedombone-utils-nodejs
+
11
−
2
View file @
f1ca6f03
...
...
@@ -72,6 +72,7 @@ function mesh_install_nodejs {
$mesh_install_nodejs_prefix
wget https://deb.nodesource.com/gpgkey/nodesource.gpg.key
-O
/root/node.gpg.key
if
[
!
-f
"
$rootdir
/root/node.gpg.key"
]
;
then
echo
$'Unable to obtain gpg key for nodejs repo'
NODE_UPGRADE
=
exit
6389252
fi
$mesh_install_nodejs_prefix
apt-key add /root/node.gpg.key
...
...
@@ -82,9 +83,12 @@ function mesh_install_nodejs {
$mesh_install_nodejs_prefix
apt-get update
$mesh_install_nodejs_prefix
apt-get
-yq
remove
--purge
nodejs
if
[
-d
"
$rootdir
/usr/local/lib/node_modules"
]
;
then
rm
-rf
"
$rootdir
/usr/local/lib/node_modules"
if
[
!
$NODE_UPGRADE
]
;
then
if
[
-d
"
$rootdir
/usr/local/lib/node_modules"
]
;
then
rm
-rf
"
$rootdir
/usr/local/lib/node_modules"
fi
fi
if
[
-f
"
$rootdir
/usr/local/bin/node"
]
;
then
rm
"
$rootdir
/usr/local/bin/node"
fi
...
...
@@ -111,6 +115,7 @@ function mesh_install_nodejs {
if
[
!
-f
"
${
rootdir
}
/usr/local/bin/node"
]
;
then
if
[
!
-f
"
${
rootdir
}
/usr/bin/nodejs"
]
;
then
echo
$'nodejs was not installed'
NODE_UPGRADE
=
exit
63962
fi
fi
...
...
@@ -118,6 +123,7 @@ function mesh_install_nodejs {
if
[
!
-f
"
$rootdir
/usr/bin/node"
]
;
then
echo
$'/usr/bin/node not found'
NODE_UPGRADE
=
exit
7235728
fi
...
...
@@ -162,9 +168,11 @@ EOF
chmod
+x
"
$rootdir
/usr/bin/test_nodejs_install"
if
!
$mesh_install_nodejs_prefix
/usr/bin/test_nodejs_install
;
then
echo
$"nodejs version numbers did not match. Architecture is
$NPM_ARCH
."
NODE_UPGRADE
=
exit
76835282
fi
rm
"
$rootdir
/usr/bin/test_nodejs_install"
NODE_UPGRADE
=
}
function
nodejs_upgrade
{
...
...
@@ -187,6 +195,7 @@ function nodejs_upgrade {
fi
read_config_param ARCHITECTURE
get_npm_arch
NODE_UPGRADE
=
1
rootdir
=
mesh_install_nodejs
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment