From 558180942a21dc45950a7faa4c50e899bf6d4323 Mon Sep 17 00:00:00 2001 From: Wade Wegner Date: Tue, 1 Aug 2017 13:19:48 -0700 Subject: [PATCH] Updated to properly configure sfdx binary --- .profile | 5 +++++ app.js | 15 ++++++--------- 2 files changed, 11 insertions(+), 9 deletions(-) create mode 100644 .profile diff --git a/.profile b/.profile new file mode 100644 index 0000000..a8ab11a --- /dev/null +++ b/.profile @@ -0,0 +1,5 @@ +echo "Updating PATH to include Salesforce CLI ..." +export PATH=$PATH:/app/.local/share/sfdx/cli/bin/ + +echo "Updating Salesforce CLI plugin ..." +sfdx update \ No newline at end of file diff --git a/app.js b/app.js index afd245a..0e8bb00 100644 --- a/app.js +++ b/app.js @@ -172,8 +172,6 @@ router.post('/deploying', (req, res) => { const startingDirectory = process.env.STARTINGDIRECTORY; const directory = `${tokenName}-${timestamp}`; - const cli_path = process.env.CLI_PATH; - let script; let sfdxurl; @@ -181,8 +179,7 @@ router.post('/deploying', (req, res) => { case 'clone': - script = `${cli_path}sfdx force --help`; - // script = `${startingDirectory}mkdir ${directory};cd ${directory};git clone ${param} .`; + script = `${startingDirectory}mkdir ${directory};cd ${directory};git clone ${param} .`; commands.run(command, script, (result) => { console.log('temp result', result); @@ -196,7 +193,7 @@ router.post('/deploying', (req, res) => { case 'auth': sfdxurl = `echo "force://${consumerKey}:${consumerSecret}:${refresh_token}@${instance_url}" > sfdx.key`; - script = `${startingDirectory}cd ${directory};export FORCE_SHOW_SPINNER=;${sfdxurl};${cli_path}sfdx force:auth:sfdxurl:store -f sfdx.key -d`; + script = `${startingDirectory}cd ${directory};export FORCE_SHOW_SPINNER=;${sfdxurl};sfdx force:auth:sfdxurl:store -f sfdx.key -d`; commands.run(command, script, (result) => { res.json({ @@ -208,7 +205,7 @@ router.post('/deploying', (req, res) => { case 'create': - script = `${startingDirectory}cd ${directory};export FORCE_SHOW_SPINNER=;${cli_path}sfdx force:config:set instanceUrl=${instance_url};${cli_path}sfdx force:org:create -v '${access_token}' -s -f ${param}`; + script = `${startingDirectory}cd ${directory};export FORCE_SHOW_SPINNER=;sfdx force:config:set instanceUrl=${instance_url};sfdx force:org:create -v '${access_token}' -s -f ${param}`; commands.run(command, script, (result) => { res.json({ @@ -220,7 +217,7 @@ router.post('/deploying', (req, res) => { case 'push': - script = `${startingDirectory}cd ${directory};export FORCE_SHOW_SPINNER=;${cli_path}sfdx force:source:push`; + script = `${startingDirectory}cd ${directory};export FORCE_SHOW_SPINNER=;sfdx force:source:push`; commands.run(command, script, (result) => { res.json({ @@ -232,7 +229,7 @@ router.post('/deploying', (req, res) => { case 'test': - script = `${startingDirectory}cd ${directory};export FORCE_SHOW_SPINNER=;${cli_path}sfdx force:apex:test:run -r human --json | jq -r .result | jq -r .summary | jq -r .outcome`; + script = `${startingDirectory}cd ${directory};export FORCE_SHOW_SPINNER=;sfdx force:apex:test:run -r human --json | jq -r .result | jq -r .summary | jq -r .outcome`; commands.run(command, script, (result) => { res.json({ @@ -244,7 +241,7 @@ router.post('/deploying', (req, res) => { case 'url': - script = `${startingDirectory}cd ${directory};export FORCE_SHOW_SPINNER=;echo $(${cli_path}sfdx force:org:display --json | jq -r .result | jq -r .instanceUrl)"/secur/frontdoor.jsp?sid="$(${cli_path}sfdx force:org:display --json | jq -r .result | jq -r .accessToken)`; + script = `${startingDirectory}cd ${directory};export FORCE_SHOW_SPINNER=;echo $(sfdx force:org:display --json | jq -r .result | jq -r .instanceUrl)"/secur/frontdoor.jsp?sid="$(sfdx force:org:display --json | jq -r .result | jq -r .accessToken)`; commands.run(command, script, (result) => { res.json({