lib/commands/local/configure: Fix local configure when resin-wifi is not available on the image

Resolves: #2239
Change-type: patch
Signed-off-by: Marios Balamatsias <mbalamatsias@gmail.com>
This commit is contained in:
Marios Balamatsias 2021-04-09 21:15:07 +03:00
parent cc8a8513e9
commit 213e54feb1

View File

@ -269,9 +269,15 @@ export default class LocalConfigureCmd extends Command {
} else if (_.includes(files, 'resin-sample.ignore')) {
// Fresh image, new mode, accoding to https://github.com/balena-os/meta-balena/pull/770/files
await imagefs.interact(target, this.BOOT_PARTITION, async (_fs) => {
return await promisify(_fs.copyFile)(
const readFileAsync = promisify(_fs.readFile);
const writeFileAsync = promisify(_fs.writeFile);
const contents = await readFileAsync(
`${this.CONNECTIONS_FOLDER}/resin-sample.ignore`,
{ encoding: 'utf8' },
);
return await writeFileAsync(
`${this.CONNECTIONS_FOLDER}/resin-wifi`,
contents,
);
});
} else if (_.includes(files, 'resin-sample')) {