node: add --unsafe-perm to std_args only if run as root

This commit is contained in:
Dawid Dziurla 2020-02-28 12:56:38 +01:00
parent 6874c79375
commit 79a1500f2b
No known key found for this signature in database
GPG Key ID: 7B6D8368172E9B0B

View File

@ -41,15 +41,18 @@ module Language
pack = pack_for_installation
# npm install args for global style module format installed into libexec
%W[
args = %W[
-ddd
--global
--unsafe-perm
--build-from-source
--#{npm_cache_config}
--prefix=#{libexec}
#{Dir.pwd}/#{pack}
]
args << "--unsafe-perm" if ENV["USER"] == "root"
args
end
def self.local_npm_install_args