From df765ed0566731f19a16b39dfefe078fa06be77e Mon Sep 17 00:00:00 2001 From: Iuri Matias Date: Thu, 22 Mar 2018 15:36:20 -0400 Subject: [PATCH] fix version issue causing a contract to be undefined due to a pipeline error --- lib/versions/npm.js | 4 ++-- test_app/app/js/index.js | 4 ++-- test_app/config/contracts.json | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/versions/npm.js b/lib/versions/npm.js index 907988026..44b9844f7 100644 --- a/lib/versions/npm.js +++ b/lib/versions/npm.js @@ -49,7 +49,7 @@ class Npm { let tarball = registryJSON.dist.tarball; let packageDirectory = './.embark/versions/' + packageName + '/' + version + '/'; - if (fs.existsSync(packageDirectory + "/downloaded_package.tgz")) { + if (fs.existsSync(packageDirectory + "/downloaded_package.tgz") && fs.existsSync(packageDirectory + "package.json")) { if (returnContent) { let distFile = packageDirectory + returnContent; callback(null, fs.readFileSync(distFile).toString()); @@ -79,7 +79,7 @@ class Npm { let npmRegistry = "https://registry.npmjs.org/" + packageName + "/" + version; let packageDirectory = './.embark/versions/' + packageName + '/' + version + '/'; - if (fs.existsSync(packageDirectory)) { + if (fs.existsSync(packageDirectory) && fs.existsSync(packageDirectory + "package.json")) { let content; if (getFromGit && returnContent) { let distFile = packageDirectory + packageName + ".js"; diff --git a/test_app/app/js/index.js b/test_app/app/js/index.js index 9bb1b7d89..7859f1199 100644 --- a/test_app/app/js/index.js +++ b/test_app/app/js/index.js @@ -2,7 +2,7 @@ import React, { Component } from 'react'; import EmbarkJS from 'Embark/EmbarkJS'; -//import SimpleStorage from 'Embark/contracts/SimpleStorage'; +import SimpleStorage from 'Embark/contracts/SimpleStorage'; import Test from 'Embark/contracts/Test'; import Assert from 'Embark/contracts/Assert'; @@ -21,7 +21,7 @@ import 'bootstrap/dist/js/bootstrap.min.js'; import { Navbar, Jumbotron, Button } from 'react-bootstrap'; window.EmbarkJS = EmbarkJS; -//window.SimpleStorage = SimpleStorage; +window.SimpleStorage = SimpleStorage; window.Test = Test; window.Assert = Assert; diff --git a/test_app/config/contracts.json b/test_app/config/contracts.json index c15d84b00..08b92dc63 100644 --- a/test_app/config/contracts.json +++ b/test_app/config/contracts.json @@ -2,7 +2,7 @@ "default": { "versions": { "web3.js": "1.0.0-beta.27", - "solc": "0.4.17" + "solc": "0.4.18" }, "deployment": { "host": "localhost",