Skip to content

How to open a file in the SAP Business Application Studio (BAS) editor with a simple command ("open <file>").

Notifications You must be signed in to change notification settings

AlexMFrank/BASopen

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 

Repository files navigation

How to open a file in the SAP Business Application Studio (BAS) editor with a simple command ("open <file>").

You can open a file with basctl --open file:// as described here: https://answers.sap.com/questions/13305362/open-file-from-terminal-in-bas-ide.html. This is is however quite a lot to write, especially since only absolute paths like /home/user/project/<projectname>/package.json are accepted. So I added the following helper script:

Create file /home/bin/open:

    touch /home/bin/open

Open the newly created file:

    basctl --open file://home/bin/open

Insert within /home/bin/open:

	#!/bin/bash
	abspath=$(realpath $1) 
	basctl --open file://$abspath

Grant the authorization to execute the script:

	chmod +x /home/bin/open

Open .bashrc:

	basctl --open file://home/user/.bashrc

Append at the end of file /home/user/.bashrc:

	export PATH="/home/bin:$PATH"

Now you can open a file with the command open <RelativePath> or open <AbsolutePath> in the BAS editor, like:

    open package.json

About

How to open a file in the SAP Business Application Studio (BAS) editor with a simple command ("open <file>").

Resources

Stars

Watchers

Forks