preload: Warn that zip files are only accepted for Intel Edison

Change-type: patch
Signed-off-by: Kyle Harding <kyle@balena.io>
This commit is contained in:
Kyle Harding 2021-06-23 16:01:51 -04:00
parent 1dba5cc7c1
commit fec96b41ee
No known key found for this signature in database
GPG Key ID: 2AD73EC1FB4865E3

View File

@ -169,6 +169,14 @@ Can be repeated to add multiple certificates.\
try { try {
const fs = await import('fs'); const fs = await import('fs');
await fs.promises.access(params.image); await fs.promises.access(params.image);
const path = await import('path');
if (path.extname(params.image) === '.zip') {
console.warn(stripIndent`
------------------------------------------------------------------------------
Warning: A zip file is only accepted for the Intel Edison device type.
------------------------------------------------------------------------------
`);
}
} catch (error) { } catch (error) {
throw new ExpectedError( throw new ExpectedError(
`The provided image path does not exist: ${params.image}`, `The provided image path does not exist: ${params.image}`,