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
Add pull and push command line option support to allow integration with third party build tools (see README for more details)
Allow subDirPattern to use display values instead of sys_ids
Add search support to download the whole record (for reference only) and optionally ignore individual field files
See also [Search Command Line Usage](#search-command-line-usage) for more details.
108
117
109
118
110
119
111
-
As you make changes to mapped files, you'll see messages logged showing the sync processing.
120
+
As you make changes to mapped files, you'll see messages and notifications on the sync status.
112
121
113
122
If you are using the default config then you will already have all the appropriate folders created for you and some test script include files that will have been downloaded from the instance. See "preLoad" and "createAllFolders" options below.
114
123
115
-
Additionally, you can sync more files by adding an empty file corresponding to an instance record. You can do this from your editor
124
+
#### How to get fields to files and then update the instance record
125
+
126
+
You can sync more files by adding an empty file corresponding to an instance record. You can do this from your editor
116
127
or IDE, or via the command line.
117
128
118
-
Adding the empty JSUtil.js file will cause FileSync to sync the (OOB) JSUtil script include to the file. Any changes to
119
-
this local file will now be synced to the mapped instance.
129
+
Adding an empty JSUtil.js file in the script_includes folder will cause FileSync to sync the (OOB) JSUtil script include to the file. Any changes to this local file will now be synced to the mapped instance.
120
130
121
-
The basic workflow is to initially create a script on ServiceNow (script include, business rule, ui script, etc.), then
122
-
add an empty file of the same name (and mapped extension) to a mapped local folder.
131
+
The basic workflow is to initially create a record/script on ServiceNow (script include, business rule, ui script, etc.), then
132
+
add an empty file of the same name (and mapped extension) to a mapped local folder (defined in config and displayed at startup).
123
133
124
134
FileSync can not support creating new records in ServiceNow by simply adding local files since there are
125
-
additional fields and rules that can not be evaluated locally. Always start by creating a new
135
+
additional fields and rules that cannot be evaluated locally. Always start by creating a new
126
136
record on the instance, then add the empty local file and start editing your script.
debug | Bool: true / false | false | Enable more verbose debugging. Useful to troubleshoot connection issues.
272
+
search | Object | empty | Define search criteria for searching. See [Search Command Line Usage](#search-command-line-usage) for more details.
262
273
ignoreDefaultFolders | Bool: true / false | false | If false then utilise record to folder mapping defined in **lib/records.config.json**.<br />If true then the **"folders"** property must be set as described below.
263
274
folders | Object listing folders | not set (inherited) | See **lib/records.config.json** as an example for format and usage. If this property is defined then it will override that defined in **lib/records.config.json** on a per folder level. This is an easy way to specify more mappings without modifying core files. If "ignoreDefaultFolders " is set to true then **lib/records.config.json** is completely ignored and all mappings must be defined in the "folders" property.
264
275
createAllFolders | Bool: true / false | false | Creates all folders specified by folders (if set) or the default **lib/records.config.json** file.
@@ -286,12 +297,12 @@ This is also useful if you want to create a backup of your current setup.
286
297
Command Line Usage:
287
298
288
299
````
289
-
./node-darwin src/app --config <config to use> --export <new config file>
300
+
node bin/app.js --config <config to use> --export <new config file>
The resulting json file will **not** include your authentication information. It will include the folder setup you used and a preLoadList listing all the records you have previously downloaded. This is very handy for getting new team members setup and providing them an easy reference to important files. Eg, for CMS development this could mean theme CSS/SASS, UI Macros, UI Pages and various script includes.
@@ -374,7 +385,17 @@ The search component enforces using the config file instead of the command line
Note that the defaults are to search in demo mode without downloading any records.
398
427
@@ -408,16 +437,66 @@ Search unlocks a great deal of potential. Here are some ideas showing how you ca
408
437
* Export all description content or story content or ANY attribute from any table in bulk. Could identify documentation issues.
409
438
* Export entire records but only the fields of interest. Eg, description field, script field, last modification date etc.
410
439
440
+
## Pull and Push Commands
441
+
442
+
The command line options `--pull` and `--push` allow integration with third party tools and scripts. Pull will retrieve a record given a **sys_id**, **search query** or **file path** which includes the table name and the file to save to. Depending on the input, either all defined fields in the config file will be output to files or just the field specified based on the file name suffix. Push will update the instance record field if the items are in sync.
443
+
444
+
Note that the default functionality for a pull is to download the file unlike when using `--search` which requires the `--download` option. Existing files will be overwritten.
Considering ServiceNow does not handle merge conflicts at all, this is a major goal of this tool! Contributions to help achieve this road map or improve the tool in general are **greatly** appreciated.
415
493
416
494
-[ ] instance comparison (eg. compare specific tables based on custom records)]
417
-
-[ ] extend API to allow push and pull options that could be called from an external tool
495
+
-[x] extend API to allow push and pull options that could be called from an external tool
496
+
-[ ] Allow FileSync to be used in task build processes (extend API and 'pluggable' functionality)
418
497
-[ ] allow configuring pre and post hooks (similar to a Grunt/Gulp/Git systems)
419
498
-[ ] add pre-push hook for validation against best practice, JSHint and customisable rule sets
420
-
-[] allow saving complete record as XML (via search tool)
499
+
-[x] allow saving complete record as XML (via search tool)
421
500
-[ ] when an update conflict has been detected write out the remote file and launch a diff app (command line "diff" or mac OS XCode "FileMerge" via "`opendiff <left> <right>`") for the user to help resolve the differences
422
501
-[ ] allow upload override of server record if the user has made a merge of remote and local data
423
502
-[ ] split out components into separate modules (eg, sn-search, sn-sync, sn-rest)
0 commit comments