Skip to content

Commit 3f8b651

Browse files
authored
Fix vpn profile import cli (#1295)
* Change working directory in command * Fix typo in command name in skipCommand array * Fix casing for script name
1 parent a363467 commit 3f8b651

File tree

3 files changed

+8
-6
lines changed

3 files changed

+8
-6
lines changed

packages/cli/commands/importVpn.ts

+3-1
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,12 @@ export function importVpn(): Command {
77

88
command.description("Import VPN profiles into OpenVPN").action(() => {
99
const scriptPath = path.resolve(__dirname, "../../../../scripts/import-openvpn-profiles.sh")
10+
const scriptDir = path.dirname(scriptPath)
1011

1112
const child = spawn("bash", [scriptPath], {
1213
stdio: "inherit", // Allow input/output to flow through the terminal
13-
shell: true // Use the shell for better compatibility
14+
shell: true, // Use the shell for better compatibility
15+
cwd: scriptDir
1416
})
1517

1618
child.on("close", (code) => {

packages/cli/index.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ const cli = new Command()
4040
.addCommand(conductor())
4141
.addCommand(cloudwatch())
4242

43-
const skipCommands = ["wiki", "fetch-image", "dev-sgs", "cloudwatch", "import-vpn"]
43+
const skipCommands = ["wiki", "fetch-image", "dev-sgs", "cloudwatch", "import-vpn-profiles"]
4444
if (!skipCommands.some((c) => process.argv.includes(c))) {
4545
applyEnvironmentOptionHooks(cli)
4646
}

scripts/import-openvpn-profiles.sh

+4-4
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,18 @@
22

33
OPENVPN_CLIENT="/Applications/OpenVPN Connect/OpenVPN Connect.app/contents/MacOS/OpenVPN Connect"
44

5-
WORKSPACE=production aws-vault exec qsolution-production -- ./scripts/get_vpn_config.sh
5+
WORKSPACE=production aws-vault exec qsolution-production -- ./get-vpn-config.sh
66
"$OPENVPN_CLIENT" --remove-profile="B7 Production"
77
"$OPENVPN_CLIENT" --import-profile="~/cjse-production-config.ovpn" --name="B7 Production"
88

9-
WORKSPACE=preprod aws-vault exec qsolution-pre-prod -- ./scripts/get_vpn_config.sh
9+
WORKSPACE=preprod aws-vault exec qsolution-pre-prod -- ./get-vpn-config.sh
1010
"$OPENVPN_CLIENT" --remove-profile="B7 Preprod"
1111
"$OPENVPN_CLIENT" --import-profile="~/cjse-preprod-config.ovpn" --name="B7 Preprod"
1212

13-
WORKSPACE=uat aws-vault exec bichard7-shared-uat -- ./scripts/get_vpn_config.sh
13+
WORKSPACE=uat aws-vault exec bichard7-shared-uat -- ./get-vpn-config.sh
1414
"$OPENVPN_CLIENT" --remove-profile="B7 UAT"
1515
"$OPENVPN_CLIENT" --import-profile="~/cjse-uat-config.ovpn" --name="B7 UAT"
1616

17-
WORKSPACE=e2e-test aws-vault exec bichard7-shared-e2e-test -- ./scripts/get_vpn_config.sh
17+
WORKSPACE=e2e-test aws-vault exec bichard7-shared-e2e-test -- ./get-vpn-config.sh
1818
"$OPENVPN_CLIENT" --remove-profile="B7 e2e test"
1919
"$OPENVPN_CLIENT" --import-profile="~/cjse-e2e-test-config.ovpn" --name="B7 e2e test"

0 commit comments

Comments
 (0)