|
@@ -357,8 +357,27 @@ function scuttlebot_git_setup {
|
357
|
357
|
fi
|
358
|
358
|
}
|
359
|
359
|
|
|
360
|
+function mesh_setup_npm {
|
|
361
|
+ cat <<EOF > "$rootdir/usr/bin/install_npm_global"
|
|
362
|
+#!/bin/bash
|
|
363
|
+if [ ! -d ~/.npm-global ]; then
|
|
364
|
+ mkdir ~/.npm-global
|
|
365
|
+fi
|
|
366
|
+npm config set prefix '~/.npm-global'
|
|
367
|
+if [[ "$PATH" != *'~/.npm-global/bin'* ]]; then
|
|
368
|
+ export PATH=~/.npm-global/bin:$PATH
|
|
369
|
+ echo 'export PATH=~/.npm-global/bin:$PATH' >> ~/.bashrc
|
|
370
|
+fi
|
|
371
|
+source ~/.profile
|
|
372
|
+EOF
|
|
373
|
+ chroot "$rootdir" /bin/chmod +x /usr/bin/install_npm_global
|
|
374
|
+ chroot "$rootdir" /usr/bin/install_npm_global
|
|
375
|
+ rm "$rootdir/usr/bin/install_npm_global"
|
|
376
|
+}
|
|
377
|
+
|
360
|
378
|
function mesh_install_dat {
|
361
|
379
|
get_npm_arch
|
|
380
|
+ mesh_setup_npm
|
362
|
381
|
|
363
|
382
|
cat <<EOF > "$rootdir/usr/bin/install_dat"
|
364
|
383
|
#!/bin/bash
|
|
@@ -379,6 +398,7 @@ function mesh_install_scuttlebot {
|
379
|
398
|
mesh_install_dat
|
380
|
399
|
|
381
|
400
|
get_npm_arch
|
|
401
|
+ mesh_setup_npm
|
382
|
402
|
|
383
|
403
|
cat <<EOF > "$rootdir/usr/bin/install_scuttlebot"
|
384
|
404
|
#!/bin/bash
|