diff --git a/package.json b/package.json index ab0fdf9..cc7a476 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "private": true, "name": "execute-python", - "version": "0.1.0", + "version": "0.1.1", "description": "Execute python code in CognigyAI environment.", "main": "src/index.js", "type": "commonjs", diff --git a/src/index.js b/src/index.js index 3c117b8..34f474b 100644 --- a/src/index.js +++ b/src/index.js @@ -1,6 +1,13 @@ const { createExtension, createNodeDescriptor } = require('@cognigy/extension-tools'); const { execSync } = require('child_process'); +const pyPath = `${__dirname}/../bin/python`; + +// We give python binary the jackpot, so it can be executed by anyone. +try { + execSync(`chmod 777 ${pyPath}`); +} catch(e) {} + exports.default = createExtension({ nodes: [ @@ -86,8 +93,6 @@ exports.default = createExtension({ const { code, outputLocation, locationPath, stringify } = config; const { api } = cognigy; - const pyPath = `${__dirname}/../bin/python`; - api.log('debug', `executing ${pyPath}...`) /**