Skip to content

Commit

Permalink
fix: Resolving ingredient version loading for just downloaded ingredi…
Browse files Browse the repository at this point in the history
…ents
  • Loading branch information
whilke committed May 15, 2019
1 parent 94326da commit 39f841c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
10 changes: 7 additions & 3 deletions core/src/ingredient-manager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { IIngredient, IIngredientType, IBaseUtilityType } from "./bake-interface
import { BaseIngredient } from "./base-ingredient"
import {DeploymentContext} from "./deployment-context"
import * as process from "process"
import * as path from "path"
import * as fs from 'fs'

export class IngredientManager {

Expand All @@ -18,8 +18,12 @@ export class IngredientManager {
var module = require(moduleName)

if (module.plugin){
let packagePath = path.join(moduleName, 'package.json')
let module_version = require(packagePath).version

let packagePath = process.env['npm_ingredient_root'] + '/' + moduleName + '/package.json';

let content = fs.readFileSync(packagePath).toString('utf-8')
let json = JSON.parse(content)
let module_version = json.version

IngredientManager.ingredientTypes.set(module.pluginNS, module.plugin)
IngredientManager.ingredientTypesVersions.set(module.pluginNS, module_version)
Expand Down
1 change: 0 additions & 1 deletion system/src/bake-loader.ts
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,6 @@ export class BakePackage {
skipNpm = true
}
catch(e){
logger.log(e)
}

if (!skipNpm){
Expand Down

0 comments on commit 39f841c

Please sign in to comment.