Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

How to use "atlas-..." commands in Git Bash?

YJ Huang May 16, 2020

I installed the Atlassian Plugin SDK on Windows 10 and there are some commands for plugin development.

E.g. atlas-create-confluence-plugin, atlas-confluence-jira-plugin, atlas-version, and so on.

The commands seem to be the .bat files in the "C:\Applications\Atlassian\atlassian-plugin-sdk-8.0.16\bin" folder.

I want to use the "atlas-..." commands in Git Bash.

But it said that the "bash: atlas: command not found"

How to make the "atlas-..." commands work on Git Bash ?

2 answers

1 accepted

1 vote
Answer accepted
Andy Heinzer
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
May 22, 2020

Hi YJ,

I understand that you're using the Atlassian SDK on a Windows environment.  However these commands within the SDK, such as atlas-clean, atlas-run, atlas-version, etc are expected to be run from the native OS command line, see also Frequently used commands.  For Windows that would be directly in the Command Prompt or potentially in Powershell.  For Linux this would be run in the terminal. 

My understanding is that Git Bash is a windows emulation to run git from the Windows command line.  You can still use that if you want to use git to make changes to your own code.  But those commands you referenced are not expected to be changed.  They are expected to run so that you can create a plugin, launch an Atlassian application, and/or see how your plugin will interact with a specific application.  More details in Atlassian SDK Server: Getting started.

I hope this helps.

Andy

0 votes
Dmytro_Shulha April 25, 2022

Hello @YJ Huang !

Recently installed Atlassian SDK and also using Git Bash shell, so faced same issue.

Managed to solve it in several steps:

1. Modity Path environment variable, add %ATLAS_HOME%\bin

2. In Git Bash, execute command with specifying it's extension: atlas-version.bat

atlassian-plugin-sdk-execute-in-git-bash-env.png

Dmytro_Shulha April 25, 2022

Git Bash doesn't allow to omit .bat extension and this feature haven't been implemented since 2013.

https://github.com/msysgit/msysgit/issues/101

Dmytro_Shulha July 7, 2023

There is a workaround suggested here to make commands work in Git Bash without needing to add {{.bat}} extension on each call.

Basically, they propose to create a text file with `.exe` extension beside each `.bat` file and fill it with `script-name.bat "$@"` string. So, for example, for `atlas-version.bat` there should be `atlas-version.exe file, and if you open it with notepad++, it should contain `atlas-version.bat "$@"` string.

Here, I made a bash one-line script to automate creation of such `.exe` files:

cd /c/Applications/Atlassian/atlassian-plugin-sdk-8.2.7/bin

ls -l *.bat | awk '{print $9}' | sed s/.bat//g | xargs -I % bash -c 'echo %.bat \"\$\@\" > %.exe'

Suggest an answer

Log in or Sign up to answer