SAP-archive / devops-cm-client

Simple command line interface to handle basic change management related actions via ODATA requests.
Apache License 2.0
36 stars 15 forks source link

cmclient --help on Windows not working #63

Closed Utkarshk7 closed 3 years ago

Utkarshk7 commented 3 years ago

When I run any command related to cmclient, I get an error 'cmclient' is not recognized as an internal or external command,operable program or batch file.

As I understand, this is because the cmclient is Unix Executable file. While it works without an issue in Mac OS, I am unable to run it on Windows.

Can someone please guide how to proceed?

rodibrin commented 3 years ago

@Utkarshk7 The cmclient is implemented in Java so you can run is on all platforms providing a Java runtime. Within the bin folder you have a batch file for windows and unix :

I guess you forgot to extend your PATH variable.

SET CMCLIENT_HOME=<CMClient-Path>
SET Path=%Path%;%CMCLIENT_HOME%\bin

Hope that helps

Utkarshk7 commented 3 years ago

Thanks for the quick response rodibrin. I can see just the cmclient (unix executable file) and not cmclient.bat within the bin folder.

I extracted from https://repo1.maven.org/maven2/com/sap/devops/cmclient/dist.cli/2.0.1/ --> dist.cli-2.0.1.tar.gz

I rechecked and I have extended PATH variable as suggested by you.

I also renamed the cmclient file to cmclient.bat and it didn't work (As I expected)

Am I missing something?

Thanks!

rodibrin commented 3 years ago

@Utkarshk7 It seems I created cmclient.bat on my own :-). Try

@echo off
setlocal

set CMCLIENT_HOME=%~dp0..
SET CMCLIENT_EXEC=java.exe
set CMCLIENT_LIB=%CMCLIENT_HOME%\lib\*

IF DEFINED JAVA_HOME SET CMCLIENT_EXEC="%JAVA_HOME%\bin\java.exe"

%CMCLIENT_EXEC% %CMCLIENT_OPTS% -cp "%CMCLIENT_LIB%;" sap.prd.cmintegration.cli.ExitWrapper %*
Utkarshk7 commented 3 years ago

Thanks a ton rodibrin :) That was great help :) Worked like a charm !!!