@dynamicweb/cli 1.0.12 → 1.0.13
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/bin/commands/install.js +8 -2
- package/bin/commands/login.js +4 -4
- package/package.json +1 -1
package/bin/commands/install.js
CHANGED
|
@@ -13,6 +13,11 @@ export function installCommand() {
|
|
|
13
13
|
.positional('filePath', {
|
|
14
14
|
describe: 'Path to the file to install'
|
|
15
15
|
})
|
|
16
|
+
.option('queue', {
|
|
17
|
+
alias: 'q',
|
|
18
|
+
type: 'boolean',
|
|
19
|
+
describe: 'Queues the install for next Dynamicweb recycle'
|
|
20
|
+
})
|
|
16
21
|
},
|
|
17
22
|
handler: (argv) => {
|
|
18
23
|
if (argv.verbose) console.info(`Installing file located at :${argv.filePath}`)
|
|
@@ -25,13 +30,14 @@ async function handleInstall(argv) {
|
|
|
25
30
|
let env = await setupEnv(argv);
|
|
26
31
|
let user = await setupUser(argv, env);
|
|
27
32
|
await uploadFiles(env, user, [ argv.filePath ], 'System/AddIns/Local', false, true);
|
|
28
|
-
await installAddin(env, user, resolveFilePath(argv.filePath))
|
|
33
|
+
await installAddin(env, user, resolveFilePath(argv.filePath), argv.queue)
|
|
29
34
|
}
|
|
30
35
|
|
|
31
|
-
async function installAddin(env, user, resolvedPath) {
|
|
36
|
+
async function installAddin(env, user, resolvedPath, queue) {
|
|
32
37
|
console.log('Installing addin')
|
|
33
38
|
let filename = path.basename(resolvedPath);
|
|
34
39
|
let data = {
|
|
40
|
+
'Queue': queue,
|
|
35
41
|
'Ids': [
|
|
36
42
|
`${filename.substring(0, filename.lastIndexOf('.')) || filename}|${path.extname(resolvedPath)}`
|
|
37
43
|
]
|
package/bin/commands/login.js
CHANGED
|
@@ -118,6 +118,7 @@ async function loginInteractive(result, verbose) {
|
|
|
118
118
|
getConfig().env[result.environment].users[result.username].apiKey = apiKey;
|
|
119
119
|
getConfig().env[result.environment].current = getConfig().env[result.environment].current || {};
|
|
120
120
|
getConfig().env[result.environment].current.user = result.username;
|
|
121
|
+
console.log("You're now logged in as " + result.username)
|
|
121
122
|
updateConfig();
|
|
122
123
|
}
|
|
123
124
|
|
|
@@ -131,12 +132,11 @@ async function login(username, password, env, protocol, verbose) {
|
|
|
131
132
|
headers: {
|
|
132
133
|
'Content-Type': 'application/x-www-form-urlencoded'
|
|
133
134
|
},
|
|
134
|
-
agent: getAgent(protocol)
|
|
135
|
+
agent: getAgent(protocol),
|
|
136
|
+
redirect: "manual"
|
|
135
137
|
});
|
|
136
138
|
|
|
137
|
-
if (res.ok) {
|
|
138
|
-
console.log(res)
|
|
139
|
-
console.log(res.json())
|
|
139
|
+
if (res.ok || res.status == 302) {
|
|
140
140
|
let user = parseCookies(res.headers.get('set-cookie')).user;
|
|
141
141
|
if (!user) return;
|
|
142
142
|
return await getToken(user, env, protocol, verbose)
|
package/package.json
CHANGED