@jsreport/jsreport-cli 3.2.0 → 3.2.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -7,6 +7,10 @@ See http://jsreport.net/learn/cli for documentation
7
7
 
8
8
  ## Changelog
9
9
 
10
+ ### 3.2.2
11
+
12
+ - add support for tempDirectory and service name to win-install command
13
+
10
14
  ### 3.2.0
11
15
 
12
16
  - change the configure command questions to fit better with new `trustUserCode` option
@@ -143,10 +143,7 @@ exports.handler = async (argv) => {
143
143
  type: 'confirm',
144
144
  name: 'createExamples',
145
145
  message: 'Would you like that we create some default examples for you?',
146
- default: true,
147
- when: (answers) => {
148
- return answers.store === 'fs' || answers.store.indexOf('fs') === 0
149
- }
146
+ default: true
150
147
  }
151
148
  ]
152
149
 
@@ -9,6 +9,17 @@ const command = 'win-install'
9
9
  exports.command = command
10
10
  exports.description = description
11
11
 
12
+ exports.builder = (yargs) => {
13
+ return (
14
+ yargs
15
+ .usage('install jsreport as a windows service\njsreport win-install\njsreport win-install --name my-service --tempDirectory=mytemp')
16
+ .option('name', {
17
+ description: 'ServiceName',
18
+ type: 'string'
19
+ })
20
+ )
21
+ }
22
+
12
23
  exports.handler = (argv) => {
13
24
  return new Promise((resolve, reject) => {
14
25
  const verbose = argv.verbose
@@ -50,13 +61,14 @@ exports.handler = (argv) => {
50
61
 
51
62
  pathToApp = appInfo.path
52
63
 
53
- if (!appInfo.name) {
54
- customError = new Error('To install app as windows service you need to pass "name" in appInfo')
64
+ serviceName = argv.name || appInfo.name
65
+ if (!serviceName) {
66
+ customError = new Error('To install app as windows service you need to pass "name" args or in appInfo')
55
67
  customError.cleanState = true
56
68
  return reject(customError)
57
69
  }
58
70
 
59
- serviceName = appInfo.name
71
+ appInfo.name = serviceName
60
72
 
61
73
  if (appInfo.startcmd) {
62
74
  hasEntry = true
@@ -103,9 +115,15 @@ exports.handler = (argv) => {
103
115
  winser = Winser({ silent: !verbose, nssmPath: staticPaths.nssm })
104
116
  }
105
117
 
118
+ let tempDirectory = process.env.tempDirectory || argv.tempDirectory
119
+ if (tempDirectory) {
120
+ tempDirectory = path.isAbsolute(tempDirectory) ? tempDirectory : path.join(pathToApp, tempDirectory)
121
+ }
122
+
106
123
  winser.install({
107
124
  path: pathToApp,
108
- autostart: true
125
+ autostart: true,
126
+ env: tempDirectory ? [`tempDirectory=${tempDirectory}`] : null
109
127
  }, (err) => {
110
128
  if (err) {
111
129
  const error = new Error('Error while trying to install windows service')
@@ -9,6 +9,17 @@ const command = 'win-uninstall'
9
9
  exports.command = command
10
10
  exports.description = description
11
11
 
12
+ exports.builder = (yargs) => {
13
+ return (
14
+ yargs
15
+ .usage('uninstall jsreport windows service\njsreport win-uninstall\njsreport win-uninstall --name my-service')
16
+ .option('name', {
17
+ description: 'ServiceName',
18
+ type: 'string'
19
+ })
20
+ )
21
+ }
22
+
12
23
  exports.handler = (argv) => {
13
24
  return new Promise((resolve, reject) => {
14
25
  const verbose = argv.verbose
@@ -48,13 +59,14 @@ exports.handler = (argv) => {
48
59
 
49
60
  pathToApp = appInfo.path
50
61
 
51
- if (!appInfo.name) {
52
- customError = new Error('To uninstall windows service for app you need to pass "name" in appInfo')
62
+ serviceName = argv.name || appInfo.name
63
+ if (!serviceName) {
64
+ customError = new Error('To uninstall windows service for app you need to pass "name" in args or in appInfo')
53
65
  customError.cleanState = true
54
66
  return reject(customError)
55
67
  }
56
68
 
57
- serviceName = appInfo.name
69
+ appInfo.name = serviceName
58
70
  } else {
59
71
  pathToApp = cwd
60
72
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jsreport/jsreport-cli",
3
- "version": "3.2.0",
3
+ "version": "3.2.2",
4
4
  "description": "Command line interface for jsreport",
5
5
  "keywords": [
6
6
  "jsreport",
@@ -70,11 +70,11 @@
70
70
  "yargs": "17.3.1"
71
71
  },
72
72
  "devDependencies": {
73
- "@jsreport/jsreport-authentication": "3.3.1",
74
- "@jsreport/jsreport-core": "3.6.0",
75
- "@jsreport/jsreport-express": "3.4.1",
76
- "@jsreport/jsreport-fs-store": "3.2.1",
77
- "@jsreport/jsreport-handlebars": "3.1.0",
73
+ "@jsreport/jsreport-authentication": "3.3.2",
74
+ "@jsreport/jsreport-core": "3.8.0",
75
+ "@jsreport/jsreport-express": "3.4.2",
76
+ "@jsreport/jsreport-fs-store": "3.2.3",
77
+ "@jsreport/jsreport-handlebars": "3.2.1",
78
78
  "cross-env": "5.2.1",
79
79
  "execa": "1.0.0",
80
80
  "handlebars": "4.7.7",