File tree Expand file tree Collapse file tree 3 files changed +8
-3
lines changed
Filter options
Expand file tree Collapse file tree 3 files changed +8
-3
lines changed
Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " jspython-cli" ,
3
- "version" : " 2.1.17 " ,
3
+ "version" : " 2.1.18 " ,
4
4
"description" : " CLI for jspython. Allows you to run jspython (*.jspy) files" ,
5
5
"main" : " ./lib/public-api.js" ,
6
6
"bin" : {
Original file line number Diff line number Diff line change @@ -75,7 +75,7 @@ function getOptionsFromArguments(rawArgs: string[]): InterpreterOptions {
75
75
async function main ( ) {
76
76
const options = getOptionsFromArguments ( process . argv ) ;
77
77
const interpreter : Interpreter = ( await jsPythonForNode ( options ) ) as Interpreter ;
78
- const jspyContext : Record < string , any > = { ...initialScope , ... { args : options . params } } ;
78
+ const jspyContext : Record < string , any > = { ...initialScope } ;
79
79
80
80
if ( options . version ) {
81
81
console . log ( interpreter . jsPythonInfo ( ) ) ;
@@ -123,6 +123,12 @@ async function main() {
123
123
const scripts = fs . readFileSync ( fileName , 'utf8' ) ;
124
124
console . log ( interpreter . jsPythonInfo ( ) ) ;
125
125
console . log ( `> ${ options . file } ` ) ;
126
+ jspyContext . __env = {
127
+ args : options . params ,
128
+ entryFunction : options . entryFunction || '' ,
129
+ entryModule : options . file ,
130
+ runsAt : 'jspython-cli'
131
+ } ;
126
132
try {
127
133
const res = await interpreter . evaluate (
128
134
scripts ,
Original file line number Diff line number Diff line change @@ -6,7 +6,6 @@ import { trimChar } from './utils';
6
6
7
7
const rootFolder = process . cwd ( ) . split ( '\\' ) . join ( '/' ) ;
8
8
export const initialScope : any = {
9
- __name__ : 'main' ,
10
9
session : { } ,
11
10
asserts : [ ] as AssertInfo [ ]
12
11
} ;
You can’t perform that action at this time.
0 commit comments