How to create a custom command to run currently opened prolog file using swipl

I have multiple prolog files in a directory and want to conveniently run them using builder ui. i made a program with hardcoded filename of prolog file: swipl ./lab2.prolog. I want to lab2.prolog be replaced with a filename of currently opened file, something like swipl $CURR_FILE

That’s a nice idea I hadn’t thought about before when using the shellcmd plugin. Once plugins/shellcmd: provide most recent page file path/uri (27b75a58) · Commits · GNOME / gnome-builder · GitLab is in Nightly you can set your command to something like this:

sh -c 'echo $CURRENT_FILE_PATH'

Unfortunately the sh -c is required to get the variable to expand.