Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor hs project download (Other half in cli-lib) #907

Merged
merged 6 commits into from
Aug 3, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions packages/cli/commands/project/download.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,11 @@ exports.handler = async options => {
await loadAndValidateOptions(options);

const { projectConfig } = await getProjectConfig();
kemmerle marked this conversation as resolved.
Show resolved Hide resolved
const platformVersion =
projectConfig && projectConfig.platformVersion
? projectConfig.platformVersion
: '';

if (projectConfig) {
logger.warn(i18n(`${i18nKey}.warnings.cannotDownloadWithinProject`));
process.exit(EXIT_CODES.WARNING);
kemmerle marked this conversation as resolved.
Show resolved Hide resolved
}

const { project, dest, buildNumber } = options;
let { project: promptedProjectName } = await downloadProjectPrompt(options);
Expand Down Expand Up @@ -84,8 +85,7 @@ exports.handler = async options => {
const zippedProject = await downloadProject(
accountId,
projectName,
buildNumberToDownload,
platformVersion
buildNumberToDownload
);

await extractZipArchive(
Expand Down
2 changes: 2 additions & 0 deletions packages/cli/lang/en.lyaml
Original file line number Diff line number Diff line change
Expand Up @@ -589,6 +589,8 @@ en:
errors:
downloadFailed: "Something went wrong downloading the project"
projectNotFound: "Your project {{ projectName }} could not be found in {{ accountId }}"
warnings:
cannotDownloadWithinProject: "Cancelling project download. Please run the command again outside the context of an existing project."
options:
buildNumber:
describe: "The build number to download"
Expand Down