File tree Expand file tree Collapse file tree 1 file changed +40
-1
lines changed Expand file tree Collapse file tree 1 file changed +40
-1
lines changed Original file line number Diff line number Diff line change 13
13
Requires [ Node] ( https://nodejs.org/en/ ) version 6 or above.
14
14
15
15
``` sh
16
- npm install --save commit-message-install
16
+ npm install --save-dev commit-message-install
17
17
```
18
18
19
19
## Use
20
20
21
+ ### Install NPM package from commit message
22
+
23
+ Imagine you have a CI build that installs NPM dependencies, but you also want to
24
+ override one or more dependencies and test by creating a commit. Instead of changing
25
+ ` package.json ` you can make a commit message with embedded JSON block describing
26
+ custom installation. Then use this CLI tool to install based on the commit message.
27
+
28
+ Example CI file command
29
+
30
+ ```
31
+ - npm i -g commit-message-install
32
+ - commit-message-install
33
+ ```
34
+
35
+ If commit message is this
36
+
37
+ ```
38
+ this will install package debug and chalk and while
39
+ installing them will set environment variable FOO to "bar".
40
+ The install will happen on all platforms
41
+
42
+ ```json
43
+ {
44
+ "platform": "*",
45
+ "packages": "debug,chalk"
46
+ }
47
+ ```
48
+
49
+ Happy installation
50
+ ```
51
+
52
+ ** note** ` platform ` can be ` * ` or specific one like ` darwin ` (from Node ` os.platform() ` ) or a
53
+ list of several platforms like ` darwin,linux `
54
+
55
+ ## Debugging
56
+
57
+ - Run this tool with ` DEBUG=commit-message-install ` environment variable set
58
+ - Force reading commit message from a local file with ` --file <filename> ` option
59
+
21
60
### Small print
22
61
23
62
Author: Gleb Bahmutov < ; gleb.bahmutov@gmail.com > ; © ; 2017
You can’t perform that action at this time.
0 commit comments