Update resin-image-fs to stop non-config commands failing in node 10

This doesn't fix actual usage of image fs, just makes it possible to
stop commands that don't use it from failing entirely.

Connects-To: #869
Change-Type: patch
This commit is contained in:
Tim Perry 2018-04-30 10:24:43 +02:00
parent 297ff86895
commit 2c46c59a79
4 changed files with 9 additions and 11 deletions

View File

@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
### ###
BOOT_PARTITION = { primary: 1 } BOOT_PARTITION = 1
CONNECTIONS_FOLDER = '/system-connections' CONNECTIONS_FOLDER = '/system-connections'
getConfigurationSchema = (connnectionFileName = 'resin-wifi') -> getConfigurationSchema = (connnectionFileName = 'resin-wifi') ->
@ -51,12 +51,14 @@ getConfigurationSchema = (connnectionFileName = 'resin-wifi') ->
type: 'ini' type: 'ini'
location: location:
path: CONNECTIONS_FOLDER.slice(1) path: CONNECTIONS_FOLDER.slice(1)
partition: BOOT_PARTITION # Reconfix still uses the older resin-image-fs, so still needs an
# object-based partition definition.
partition: { primary: BOOT_PARTITION }
config_json: config_json:
type: 'json' type: 'json'
location: location:
path: 'config.json' path: 'config.json'
partition: BOOT_PARTITION partition: { primary: BOOT_PARTITION }
inquirerOptions = (data) -> [ inquirerOptions = (data) -> [
{ {

View File

@ -26,7 +26,6 @@ import ResinSdk = require('resin-sdk');
import { execute } from 'president'; import { execute } from 'president';
import { InitializeEmitter, OperationState } from 'resin-device-init'; import { InitializeEmitter, OperationState } from 'resin-device-init';
const extractStreamAsync = Promise.promisify(rindle.extract);
const waitStreamAsync = Promise.promisify(rindle.wait); const waitStreamAsync = Promise.promisify(rindle.wait);
const presidentExecuteAsync = Promise.promisify(execute); const presidentExecuteAsync = Promise.promisify(execute);
@ -82,14 +81,11 @@ export function getManifest(
// partition, but fallback to the API if // partition, but fallback to the API if
// we encounter any errors along the way. // we encounter any errors along the way.
return imagefs return imagefs
.read({ .readFile({
image, image,
partition: { partition: 1,
primary: 1,
},
path: '/device-type.json', path: '/device-type.json',
}) })
.then(extractStreamAsync)
.then(JSON.parse) .then(JSON.parse)
.catch(() => resin.models.device.getManifestBySlug(deviceType)); .catch(() => resin.models.device.getManifestBySlug(deviceType));
} }

View File

@ -141,7 +141,7 @@
"resin-device-init": "^4.0.0", "resin-device-init": "^4.0.0",
"resin-docker-build": "^0.6.2", "resin-docker-build": "^0.6.2",
"resin-doodles": "0.0.1", "resin-doodles": "0.0.1",
"resin-image-fs": "^2.3.0", "resin-image-fs": "^5.0.2",
"resin-image-manager": "^5.0.0", "resin-image-manager": "^5.0.0",
"resin-multibuild": "^0.5.1", "resin-multibuild": "^0.5.1",
"resin-preload": "^6.2.0", "resin-preload": "^6.2.0",

View File

@ -1,5 +1,5 @@
declare module 'resin-image-fs' { declare module 'resin-image-fs' {
import Promise = require('bluebird'); import Promise = require('bluebird');
export function read(options: {}): Promise<NodeJS.ReadableStream>; export function readFile(options: {}): Promise<string>;
} }