Comparing version 1.2.9 to 1.2.10
@@ -1,1 +0,1 @@ | ||
var _createClass=function(){function defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||false;descriptor.configurable=true;if("value"in descriptor)descriptor.writable=true;Object.defineProperty(target,descriptor.key,descriptor);}}return function(Constructor,protoProps,staticProps){if(protoProps)defineProperties(Constructor.prototype,protoProps);if(staticProps)defineProperties(Constructor,staticProps);return Constructor;};}();var _logger=require("./logger");var _logger2=_interopRequireDefault(_logger);function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj};}function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor)){throw new TypeError("Cannot call a class as a function");}}var _require=require("child_process"),execSync=_require.execSync;module.exports=function(){function Snapper(platform){_classCallCheck(this,Snapper);this.platform=platform.toLowerCase();}_createClass(Snapper,[{key:"snap",value:function snap(outputPath){var _this=this;if(typeof outputPath!=='string'){throw Error("Output path should be a string recieved: "+outputPath);}return new Promise(function(resolve){var outputPathWithExtension=outputPath+"."+_this.platform+".png";_logger2.default.verbose('native-snapper',"taking snapshot at path: "+outputPathWithExtension);execSync("../node_modules/.bin/osnap "+_this.platform+" -f "+outputPathWithExtension);resolve();});}}]);return Snapper;}(); | ||
var _createClass=function(){function defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||false;descriptor.configurable=true;if("value"in descriptor)descriptor.writable=true;Object.defineProperty(target,descriptor.key,descriptor);}}return function(Constructor,protoProps,staticProps){if(protoProps)defineProperties(Constructor.prototype,protoProps);if(staticProps)defineProperties(Constructor,staticProps);return Constructor;};}();var _logger=require("./logger");var _logger2=_interopRequireDefault(_logger);var _path=require("path");var _path2=_interopRequireDefault(_path);function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj};}function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor)){throw new TypeError("Cannot call a class as a function");}}var _require=require("child_process"),execSync=_require.execSync;module.exports=function(){function Snapper(platform){_classCallCheck(this,Snapper);this.platform=platform.toLowerCase();}_createClass(Snapper,[{key:"snap",value:function snap(outputPath){var _this=this;if(typeof outputPath!=='string'){throw Error("Output path should be a string recieved: "+outputPath);}return new Promise(function(resolve){var outputPathWithExtension=outputPath+"."+_this.platform+".png";_logger2.default.verbose('native-snapper',"taking snapshot at path: "+outputPathWithExtension);execSync(_path2.default.join(__dirname,'../node_modules/.bin/osnap ')+(_this.platform+" -f "+outputPathWithExtension));resolve();});}}]);return Snapper;}(); |
{ | ||
"name": "dextrose", | ||
"version": "1.2.9", | ||
"version": "1.2.10", | ||
"author": "NewsUk", | ||
@@ -5,0 +5,0 @@ "license": "MIT", |
import log from "./logger"; | ||
import path from "path"; | ||
const { | ||
@@ -19,4 +21,5 @@ execSync | ||
log.verbose('native-snapper', `taking snapshot at path: ${outputPathWithExtension}`) | ||
// TODO: need to make this reject if fails | ||
execSync(`../node_modules/.bin/osnap ${this.platform} -f ${outputPathWithExtension}`); | ||
execSync(path.join(__dirname, '../node_modules/.bin/osnap ') + `${this.platform} -f ${outputPathWithExtension}`); | ||
resolve(); | ||
@@ -23,0 +26,0 @@ }); |
247186
535