Skip to content

Commit

Permalink
fix(create-target): fixed server url
Browse files Browse the repository at this point in the history
  • Loading branch information
YuryShkoda committed May 23, 2023
1 parent 6d26ba2 commit cd0e218
Show file tree
Hide file tree
Showing 5 changed files with 65 additions and 174 deletions.
178 changes: 21 additions & 157 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 3 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,6 @@
"@types/node": "^18.14.0",
"@types/shelljs.exec": "1.1.0",
"@types/tough-cookie": "^4.0.1",
"@types/valid-url": "^1.0.3",
"@types/vscode": "^1.64.0",
"@typescript-eslint/eslint-plugin": "^5.33.1",
"@typescript-eslint/parser": "^5.33.1",
Expand All @@ -263,14 +262,13 @@
},
"dependencies": {
"@sasjs/adapter": "4.3.5",
"@sasjs/cli": "4.1.1",
"@sasjs/cli": "4.3.0",
"@sasjs/lint": "2.3.1",
"@sasjs/utils": "3.2.0",
"@sasjs/utils": "3.3.0",
"axios": "0.26.1",
"dotenv": "16.0.3",
"esbuild-plugin-copy": "2.0.1",
"node-graphviz": "0.1.1",
"shelljs.exec": "1.1.8",
"valid-url": "1.0.9"
"shelljs.exec": "1.1.8"
}
}
8 changes: 6 additions & 2 deletions src/commands/compileBuildDeploy/compileBuildDeployCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -122,15 +122,19 @@ export class CompileBuildDeployCommand extends TargetCommand {
}
}

if (isCBDFailed) return
if (isCBDFailed) {
return
}

await build(target).catch((err) => {
this.handleError(err, 'Build failed!')

isCBDFailed = true
})

if (isCBDFailed) return
if (isCBDFailed) {
return
}

await deploy(target, isLocal).catch((err) => {
this.handleError(err, 'Deploy failed!')
Expand Down
14 changes: 12 additions & 2 deletions src/utils/createTarget.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { workspace } from 'vscode'
import { window, workspace } from 'vscode'

import { Target } from '@sasjs/utils/types'
import {
Expand All @@ -22,6 +22,7 @@ export const createTarget = async () => {
serverType,
appLoc: '/Public/app'
}

let isLocal = false

if (process.isSasjsProject) {
Expand All @@ -32,12 +33,20 @@ export const createTarget = async () => {
[globalConfigPath, localConfigPath],
'Where do you want to save your target?'
)

if (choice !== globalConfigPath) {
isLocal = true
}
}

await authenticateTarget(targetJson, isLocal)
await authenticateTarget(targetJson, isLocal).catch((err) => {
const errTitle = `Error while authenticating target '${name}'.`
window.showErrorMessage(errTitle)

// TODO: create a utility
process.outputChannel.appendLine([errTitle, err.toString()].join(' '))
process.outputChannel.show()
})

const target = new Target(targetJson)

Expand All @@ -46,6 +55,7 @@ export const createTarget = async () => {
const extConfig = workspace.getConfiguration('sasjs-for-vscode')
await extConfig.update('target', target.name, true)
await extConfig.update('isLocal', isLocal, true)

await setConstants()

return { target, isLocal }
Expand Down
Loading

0 comments on commit cd0e218

Please sign in to comment.