Lazily import resin-image-fs

If for whatever reason resin-image-fs is not importable — eg. if it’s built for another arch — any command that imports `helpers.ts` will just quit without any error/traceback.
This commit is contained in:
Akis Kesoglou 2018-07-20 13:04:26 +03:00
parent 27b877dd33
commit 916cc36430

View File

@ -19,7 +19,6 @@ import Promise = require('bluebird');
import _ = require('lodash');
import chalk from 'chalk';
import rindle = require('rindle');
import imagefs = require('resin-image-fs');
import visuals = require('resin-cli-visuals');
import ResinSdk = require('resin-sdk');
@ -85,6 +84,7 @@ export function getManifest(
image: string,
deviceType: string,
): Promise<ResinSdk.DeviceType> {
const imagefs = require('resin-image-fs');
// Attempt to read manifest from the first
// partition, but fallback to the API if
// we encounter any errors along the way.