Skip to content

Add 'system.programPath' API.

Evan Welsh requested to merge ewlsh/gjs:split-argv into master

This adds a property to system, system.programPath, which somewhat mirrors system.programInvocationName.

In Deno the equivalent property is Deno.mainModule and in Node it is exposed as process.argv[1] because Node constructs process.argv like [execPath, programPath, ...programArgs].

This is helpful because system.programInvocationName only provides the relative filename/path and is set to argv[0] for the interpreter.

system.programPath is null when run via the interpreter.

Edited by Evan Welsh

Merge request reports