Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
ansible
Overview
Overview
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
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
OpenEdx
ansible
Commits
b25d4453
Commit
b25d4453
authored
Apr 04, 2013
by
Chris Hoffman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Updating version added, tweaking instantiation
parent
2580adae
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
12 deletions
+13
-12
library/npm
+13
-12
No files found.
library/npm
View file @
b25d4453
...
...
@@ -24,7 +24,7 @@ module: npm
short_description: Manage node.js packages with npm
description:
- Manage node.js packages with Node Package Manager (npm)
version_added: 1.
1
version_added: 1.
2
author: Chris Hoffman
options:
name:
...
...
@@ -90,21 +90,21 @@ except ImportError:
import
simplejson
as
json
class
Npm
(
object
):
def
__init__
(
self
,
module
,
name
,
path
,
version
,
glbl
,
production
,
executable
):
def
__init__
(
self
,
module
,
**
kwargs
):
self
.
module
=
module
self
.
glbl
=
glbl
self
.
name
=
name
self
.
version
=
version
self
.
path
=
path
self
.
production
=
production
self
.
glbl
=
kwargs
[
'glbl'
]
self
.
name
=
kwargs
[
'name'
]
self
.
version
=
kwargs
[
'version'
]
self
.
path
=
kwargs
[
'path'
]
self
.
production
=
kwargs
[
'production'
]
if
executable
:
self
.
executable
=
executable
if
kwargs
[
'executable'
]
:
self
.
executable
=
kwargs
[
'executable'
]
else
:
self
.
executable
=
module
.
get_bin_path
(
'npm'
,
True
)
if
version
:
self
.
name_version
=
name
+
'@'
+
version
if
kwargs
[
'version'
]
:
self
.
name_version
=
self
.
name
+
'@'
+
self
.
version
else
:
self
.
name_version
=
self
.
name
...
...
@@ -193,7 +193,8 @@ def main():
if
state
==
'absent'
and
not
name
:
module
.
fail_json
(
msg
=
'uninstalling a package is only available for named packages'
)
npm
=
Npm
(
module
,
name
,
path
,
version
,
glbl
,
production
,
executable
)
npm
=
Npm
(
module
,
name
=
name
,
path
=
path
,
version
=
version
,
glbl
=
glbl
,
production
=
production
,
\
executable
=
executable
)
changed
=
False
if
state
==
'present'
:
...
...
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