Skip to content
This repository has been archived by the owner on Apr 8, 2024. It is now read-only.

Commit

Permalink
refactor: syntax errors TS would have caught
Browse files Browse the repository at this point in the history
  • Loading branch information
mshanemc committed Jun 23, 2021
1 parent 97c4678 commit 7754983
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion scripts/docker-publish-full.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ const DOCKER_HUB_REPOSITORY = dockerShared.repo;

(async () => {
dockerShared.validateDockerEnv();
const SALESFORCE_CLI_VERSION = dockerShared.getCliVersion();
const SALESFORCE_CLI_VERSION = await dockerShared.getCliVersion();

shell.exec(
`docker build --file ./dockerfiles/Dockerfile_full --build-arg SALESFORCE_CLI_VERSION=${SALESFORCE_CLI_VERSION} --tag ${DOCKER_HUB_REPOSITORY}:${SALESFORCE_CLI_VERSION}-full --no-cache .`
Expand Down
3 changes: 1 addition & 2 deletions scripts/docker-publish-slim.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
*/
const shell = require('shelljs');
const got = require('got');
const fs = require('fs-extra');
const dockerShared = require('./docker-shared');

shell.set('-e');
Expand Down Expand Up @@ -43,7 +42,7 @@ const getDownloadUrl = async (version) => {
dockerShared.validateDockerEnv();

// If not in the env, read the package.json to get the version number we'll use for latest-rc
const SALESFORCE_CLI_VERSION = dockerShared.getCliVersion();
const SALESFORCE_CLI_VERSION = await dockerShared.getCliVersion();
const CLI_DOWNLOAD_URL = await getDownloadUrl(SALESFORCE_CLI_VERSION);

// build from local dockerfiles
Expand Down
4 changes: 3 additions & 1 deletion scripts/docker-shared.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
const shell = require('shelljs');
const fs = require('fs-extra');

shell.set('-e');
shell.set('+v');

const getCliVersion = () => {
const getCliVersion = async () => {
// If not in the env, read the package.json to get the version number we'll use for latest-rc
const SALESFORCE_CLI_VERSION = process.env['SALESFORCE_CLI_VERSION'] ?? (await fs.readJson('package.json')).version;
if (!SALESFORCE_CLI_VERSION) {
Expand Down

0 comments on commit 7754983

Please sign in to comment.