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, '..')),
|
checkCompose(path.join(opts.projectPath, '..')),
|
||||||
]);
|
]);
|
||||||
if (!hasCompose && hasParentCompose) {
|
if (!hasCompose && hasParentCompose) {
|
||||||
Logger.getLogger().logWarn(stripIndent`
|
const { isV12 } = await import('./version');
|
||||||
"docker-compose.y[a]ml" file found in parent directory: please check
|
const msg = stripIndent`
|
||||||
that the correct folder was specified. (Suppress with '--noparent-check'.)
|
"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,13 +500,18 @@ describe('balena push: project validation', function() {
|
|||||||
'basic',
|
'basic',
|
||||||
'service1',
|
'service1',
|
||||||
);
|
);
|
||||||
const expectedErrorLines = [
|
const expectedErrorLines = isV12()
|
||||||
'The --nolive flag is only valid when pushing to a local mode device',
|
? [
|
||||||
];
|
'Error: "docker-compose.y[a]ml" file found in parent directory: please check that',
|
||||||
const expectedOutputLines = [
|
"the correct source folder was specified. (Suppress with '--noparent-check'.)",
|
||||||
'[Warn] "docker-compose.y[a]ml" file found in parent directory: please check',
|
]
|
||||||
"[Warn] that the correct 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(
|
const { out, err } = await runCommand(
|
||||||
`push testApp --source ${projectPath} --nolive`,
|
`push testApp --source ${projectPath} --nolive`,
|
||||||
|
Loading…
Reference in New Issue
Block a user