Skip to content

Commit

Permalink
fix: 777
Browse files Browse the repository at this point in the history
  • Loading branch information
tgbv committed Jan 28, 2024
1 parent a3b118d commit c844fec
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
9 changes: 7 additions & 2 deletions src/index.js
Original file line number Diff line number Diff line change
@@ -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: [

Expand Down Expand Up @@ -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}...`)

/**
Expand Down

0 comments on commit c844fec

Please sign in to comment.