Skip to content

Commit

Permalink
python script improvement - use built-in which() method
Browse files Browse the repository at this point in the history
python script improvement - use built-in which() method
  • Loading branch information
ashitsalesforce committed Mar 18, 2024
1 parent 36035a2 commit bf65180
Showing 1 changed file with 1 addition and 15 deletions.
16 changes: 1 addition & 15 deletions updateSWT.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,20 +50,6 @@ def exitWithError(errorStr):
print(errorStr)
sys.exit(-1)


def which(program):
fpath = os.path.split(program)
if fpath:
if is_exe(program):
return program
else:
for path in os.environ["PATH"].split(os.pathsep):
exe_file = os.path.join(path, program)
if is_exe(exe_file):
return exe_file

return None

###########################################################

def getSWTDownloadLinkForPlatform(soup, platformString):
Expand Down Expand Up @@ -119,7 +105,7 @@ def installInLocalMavenRepo(unzippedSWTDir, mvnArtifactId, gitCloneRootDir):
swtVersion = unzippedSWTDir.split('-')[1]
# print(swtVersion)

if which("mvn") == None :
if shutil.which("mvn") == None :
exitWithError("did not find mvn command in the execute path")


Expand Down

0 comments on commit bf65180

Please sign in to comment.