Skip to content

Commit

Permalink
When running env import, add default "objects" property to package.json
Browse files Browse the repository at this point in the history
  • Loading branch information
jgoachermedable committed Sep 25, 2024
1 parent 6d898eb commit 11c55f6
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions packages/mdctl-import-adapter/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ const EventEmitter = require('events'),
_ = require('lodash'),
pluralize = require('pluralize'),
{ ImportSection } = require('@medable/mdctl-core/streams/section'),
{ parseString, isCustomName } = require('@medable/mdctl-core-utils/values'),
{ isSet, parseString, isCustomName } = require('@medable/mdctl-core-utils/values'),
{ md5FileHash } = require('@medable/mdctl-node-utils/crypto'),
{ privatesAccessor } = require('@medable/mdctl-core-utils/privates'),
{ OutputStream } = require('@medable/mdctl-core/streams/chunk-stream'),
Expand Down Expand Up @@ -102,8 +102,11 @@ class ImportFileTreeAdapter extends EventEmitter {

async loadPackageFromObject() {
const { packageData, input, format } = privatesAccessor(this),
section = new ImportSection(packageData, 'package', `package.${format}`, input)
return { results: [section.content], blobResults: [] }
{ content } = new ImportSection(packageData, 'package', `package.${format}`, input)
if (!isSet(content.object)) {
content.object = 'package'
}
return { results: [content], blobResults: [] }
}

async loadFileContent(f) {
Expand Down

0 comments on commit 11c55f6

Please sign in to comment.