mirror of
https://github.com/balena-io/balena-cli.git
synced 2024-12-18 21:27:51 +00:00
v12 preparations: Add feature switch for project directory validation
Connects-to: #1770 Change-type: patch
This commit is contained in:
parent
fcc13f9476
commit
2ab8ae1c10
@ -562,10 +562,15 @@ export async function validateProjectDirectory(
|
||||
checkCompose(path.join(opts.projectPath, '..')),
|
||||
]);
|
||||
if (!hasCompose && hasParentCompose) {
|
||||
Logger.getLogger().logWarn(stripIndent`
|
||||
"docker-compose.y[a]ml" file found in parent directory: please check
|
||||
that the correct folder was specified. (Suppress with '--noparent-check'.)
|
||||
`);
|
||||
const { isV12 } = await import('./version');
|
||||
const msg = stripIndent`
|
||||
"docker-compose.y[a]ml" file found in parent directory: please check that
|
||||
the correct source folder was specified. (Suppress with '--noparent-check'.)`;
|
||||
if (isV12()) {
|
||||
throw new ExpectedError(`Error: ${msg}`);
|
||||
} else {
|
||||
Logger.getLogger().logWarn(msg);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -500,12 +500,17 @@ describe('balena push: project validation', function() {
|
||||
'basic',
|
||||
'service1',
|
||||
);
|
||||
const expectedErrorLines = [
|
||||
'The --nolive flag is only valid when pushing to a local mode device',
|
||||
];
|
||||
const expectedOutputLines = [
|
||||
'[Warn] "docker-compose.y[a]ml" file found in parent directory: please check',
|
||||
"[Warn] that the correct folder was specified. (Suppress with '--noparent-check'.)",
|
||||
const expectedErrorLines = isV12()
|
||||
? [
|
||||
'Error: "docker-compose.y[a]ml" file found in parent directory: please check that',
|
||||
"the correct source folder was specified. (Suppress with '--noparent-check'.)",
|
||||
]
|
||||
: ['The --nolive flag is only valid when pushing to a local mode device'];
|
||||
const expectedOutputLines = isV12()
|
||||
? []
|
||||
: [
|
||||
'[Warn] "docker-compose.y[a]ml" file found in parent directory: please check that',
|
||||
"[Warn] the correct source folder was specified. (Suppress with '--noparent-check'.)",
|
||||
];
|
||||
|
||||
const { out, err } = await runCommand(
|
||||
|
Loading…
Reference in New Issue
Block a user