@ossy/cli 0.0.1-alpha → 0.0.2-alpha
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/package.json +1 -1
- package/src/cms/cli.js +5 -5
package/package.json
CHANGED
package/src/cms/cli.js
CHANGED
|
@@ -10,9 +10,6 @@ const config = {
|
|
|
10
10
|
// apiUrl: 'http://localhost:3001/api/v0'
|
|
11
11
|
}
|
|
12
12
|
|
|
13
|
-
const getTokenPayload = token =>
|
|
14
|
-
JSON.parse(Buffer.from(token.split('.')[1], 'base64').toString())
|
|
15
|
-
|
|
16
13
|
const importResourceTemplates = options => {
|
|
17
14
|
|
|
18
15
|
const parsedArgs = arg({
|
|
@@ -25,8 +22,11 @@ const importResourceTemplates = options => {
|
|
|
25
22
|
|
|
26
23
|
logInfo({ message: '[CMS] reading files' })
|
|
27
24
|
const token = parsedArgs['--authentication']
|
|
28
|
-
const
|
|
29
|
-
|
|
25
|
+
const filePath = resolve(parsedArgs['--ossy-file'])
|
|
26
|
+
|
|
27
|
+
const ossyfile = filePath.endsWith('json')
|
|
28
|
+
? JSON.parse(readFileSync(filePath), 'utf8')
|
|
29
|
+
: require(filePath)
|
|
30
30
|
|
|
31
31
|
if (!token) return logError({ message: '[CMS] No token provided with --authentication'})
|
|
32
32
|
if (!ossyfile?.workspaceId) return logError({ message: '[CMS] No workspaceId provided in ossy.json'})
|