You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+35-9
Original file line number
Diff line number
Diff line change
@@ -12,20 +12,25 @@ _PS: This is actually also a gulp plugin._
12
12
```bash
13
13
npm install nscabinet
14
14
```
15
-
- Install the __nscabinet restlet__ bundle in your netsuite account (or manually create the script using the file in the repo)
15
+
- Install the __nscabinet restlet__ bundle in your netsuite account (or manually create the script using the file in the repo) *
16
16
17
17
- Create a `nsconfig.json` file in the root of you project with at least __email__ , __password__, __account__, __script__ number and __deployment__ number.
18
18
19
19
- Use it with gulp or with the CLI (see CLI section below)
_(*) if installing from the bundle, the minor version must match your current version of nscabinet_
27
+
28
+
---
25
29
26
30
## Accepted input ways
27
31
28
-
The parameters may be stored in config files, in environment variables, or passed directly.
32
+
The parameters may be stored in config files, in environment variables,
33
+
or passed directly as object.
29
34
30
35
For environment variables, prefix the options with "NSCONF_" and write in uppercase.
31
36
@@ -41,7 +46,6 @@ The following priority is taken for each parameter (using `_.extend`)
41
46
42
47
For instance, let's say you call `nscabinet({ account : '1234' })`. Even if no e-mail is supplied, we also look up in the sources listed above for it. You may set a `nsconfig.json` for the project without the password, setting the latter machine-wise using an environment variable.
43
48
44
-
For more info see [nsconfig](https://github.com/suiteplus/nsconfig).
45
49
46
50
## Common parameters
47
51
@@ -53,13 +57,21 @@ __Connection__
53
57
54
58
*`role` defaults to the account's default role.
55
59
60
+
*`account`
61
+
62
+
*`email`
63
+
64
+
*`password`
65
+
66
+
*`script`
67
+
56
68
*`deployment` defaults to 1.
57
69
58
70
__Path__
59
71
60
72
*`rootPath` sets the root path on the server. Defaults to `/SuiteScripts`. Must begin with `/`.
61
73
62
-
Example: Upload file with path `img/image.jpg`with rootPath `/Templates` will "upsert" the file
74
+
Example: Upload file with path `img/image.jpg`to rootPath `/Templates` will "upsert" the file
63
75
onto '/Templates/img/image.jpg'.
64
76
65
77
## nscabinet.upload
@@ -96,10 +108,17 @@ nscabinet.download(['MyProject/*.js','/Web Site Hosting Files/My Site/*.html'])
96
108
97
109
*`files` file selector (one or many).
98
110
99
-
*`*` is accepted on the file part. The restlet then runs a file search in which `*` is replaced with `%`.
111
+
*`*` is accepted on the file part. The restlet then runs a file search by name
112
+
in which `*` is replaced with `%`.
100
113
101
114
* Paths are also relative to `opts.rootPath`. If a file selector begins with `/`, files will be queried
102
115
by absolute path in netsuite, but saved locally inside the `cabinet_root` folder.
116
+
117
+
* If a path has `/**/`, a recursive search will be done. This can be used to search
118
+
just by file name, regardless of path.
119
+
120
+
* (PS: While the syntax is similar, don't expect full glob funcionality. It's not a glob!)
121
+
103
122
104
123
*`opts` Common options.
105
124
@@ -132,7 +151,7 @@ $ nscabinet d "remote.txt" -p "/Downloads"
132
151
$ nscabinet d "remote.txt"
133
152
```
134
153
135
-
Takes in the same arguments (lowercased).
154
+
Takes in the same arguments (always lowercased).
136
155
137
156
Encase path parameters in string quotes (avoids bash expansion).
138
157
@@ -148,8 +167,15 @@ $ Views nscabinet u view.html
148
167
Uploading Views/view.html to /SuiteScripts
149
168
```
150
169
151
-
## Gulp tasks
170
+
## Contributing
152
171
153
-
**gulp/development.js** is for straightforward tasks: lint and unit tests.
172
+
- If you add new funcionality, also add a new test!
173
+
174
+
At the time tests are ran locally. To set up the tests:
154
175
155
-
**gulp/test.js** is for more involved things.
176
+
- Install the restlet in an available account;
177
+
178
+
- Set up nsconfig.json, pointing to that account; Don't forget to set
179
+
a rootPath to where the tests will play around and create its lots of files;
0 commit comments