Skip to content

Commit 34828b3

Browse files
committed
restrict --arch flag to build command only
1 parent 4bc470d commit 34828b3

File tree

3 files changed

+7
-29
lines changed

3 files changed

+7
-29
lines changed

src/commands/publish/handler.ts

Lines changed: 7 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ import { PublishCommandOptions } from "./types.js";
1111
import { publish } from "../../tasks/publish/index.js";
1212
import { parseReleaseType } from "./parseReleaseType.js";
1313
import { getPackagesToBuildProps } from "../build/variants.js";
14-
import { normalizeArchitecture } from "../build/handler.js";
1514

1615
/**
1716
* Common handler for CLI and programatic usage
@@ -29,7 +28,6 @@ export async function publishHandler({
2928
require_git_data: requireGitData,
3029
delete_old_pins: deleteOldPins,
3130
skip_compose_validation: skipComposeValidation,
32-
arch,
3331
// Global options
3432
dir = defaultDir,
3533
compose_file_name: composeFileName = defaultComposeFileName,
@@ -66,29 +64,8 @@ export async function publishHandler({
6664

6765
const variantsDirPath = path.join(dir, variantsDirName);
6866

69-
const architecture = arch ? normalizeArchitecture(arch) : undefined;
70-
7167
const isMultiVariant = !!allVariants || !!variants;
7268

73-
const packagesToBuildProps = getPackagesToBuildProps({
74-
allVariants: Boolean(allVariants),
75-
commaSeparatedVariants: variants,
76-
rootDir: dir,
77-
variantsDirPath,
78-
composeFileName
79-
});
80-
81-
// Filter architectures if --arch flag is provided
82-
if (architecture) {
83-
for (const pkg of packagesToBuildProps) {
84-
if (!pkg.architectures.includes(architecture))
85-
throw Error(
86-
`Architecture '${architecture}' is not supported by package ${pkg.manifest.name}. Supported: ${pkg.architectures.join(", ")}`
87-
);
88-
pkg.architectures = [architecture];
89-
}
90-
}
91-
9269
const publishTasks = new Listr(
9370
publish({
9471
releaseType,
@@ -105,7 +82,13 @@ export async function publishHandler({
10582
verbosityOptions,
10683
variantsDirPath,
10784
skipComposeValidation,
108-
packagesToBuildProps,
85+
packagesToBuildProps: getPackagesToBuildProps({
86+
allVariants: Boolean(allVariants),
87+
commaSeparatedVariants: variants,
88+
rootDir: dir,
89+
variantsDirPath,
90+
composeFileName
91+
}),
10992
isMultiVariant
11093
}),
11194
verbosityOptions

src/commands/publish/index.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -88,10 +88,6 @@ export const publish: CommandModule<CliGlobalOptions, PublishCommandOptions> = {
8888
alias: "skip-compose-validation",
8989
description: `Skip the Dappnode compose validation step`,
9090
type: "boolean"
91-
},
92-
arch: {
93-
description: `Specify the architecture to build for: "linux/amd64" or "linux/arm64"`,
94-
type: "string"
9591
}
9692
},
9793

src/commands/publish/types.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,5 +17,4 @@ export interface PublishCommandOptions extends CliGlobalOptions {
1717
variants?: string;
1818
all_variants?: boolean;
1919
skip_compose_validation?: boolean;
20-
arch?: string;
2120
}

0 commit comments

Comments
 (0)