Skip to content
This repository was archived by the owner on Jan 15, 2024. It is now read-only.

Commit 2edfb6c

Browse files
authored
Merge pull request #175 from willdurand/bugfix/GH-174/repair-broken-npm-package-paths
fix for #174: create `npmrc` containing prefix to build package symlinks properly (fixes #174)
2 parents fe41d67 + 2738607 commit 2edfb6c

5 files changed

Lines changed: 22 additions & 1 deletion

File tree

.travis.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ rvm:
44
- 2.1.0
55

66
env:
7-
- PUPPET_VERSION="~> 3.4.0"
87
- PUPPET_VERSION="~> 3.6.0"
98
- PUPPET_VERSION="~> 3.7.0"
109
- PUPPET_VERSION="~> 4.3.0"

Rakefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ require 'puppet_blacksmith/rake_tasks'
66
PuppetLint.configuration.log_format = "%{path}:%{line}:%{check}:%{KIND}:%{message}"
77
PuppetLint.configuration.fail_on_warnings = false
88
PuppetLint.configuration.send("disable_80chars")
9+
PuppetLint.configuration.send("disable_arrow_on_right_operand_line")
910

1011
exclude_paths = [
1112
"pkg/**/*",

manifests/instance.pp

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,17 @@
130130
}
131131
}
132132

133+
$node_prefix = $target_dir
134+
file { "nodejs-npmrc-etc-dir-${version}":
135+
ensure => directory,
136+
path => "${node_unpack_folder}/etc",
137+
} ->
138+
file { "nodejs-npmrc-${version}":
139+
ensure => present,
140+
path => "${node_unpack_folder}/etc/npmrc",
141+
content => template("${module_name}/npmrc")
142+
}
143+
133144
file { "nodejs-symlink-bin-with-version-${version}":
134145
ensure => 'link',
135146
path => $node_symlink,

spec/defines/nodejs_instance_spec.rb

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,15 @@
112112
.with_content(/(.*)\/usr\/local\/bin\/node-v6.0.0 \/usr\/local\/node\/node-v6.0.0\/bin\/npm "\$@"/)
113113
}
114114

115+
it { should contain_file('nodejs-npmrc-etc-dir-v6.0.0') \
116+
.with_ensure('directory') \
117+
.with_path('/usr/local/node/node-v6.0.0/etc')
118+
}
119+
120+
it { should contain_file('nodejs-npmrc-v6.0.0') \
121+
.with_path('/usr/local/node/node-v6.0.0/etc/npmrc')
122+
}
123+
115124
it { should_not contain_file('/usr/local/bin/node') }
116125
it { should_not contain_file('/usr/local/bin/npm') }
117126

templates/npmrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
prefix=<%= @node_prefix.sub '/bin', '' %>

0 commit comments

Comments
 (0)