From 54037bb2a8aee33fd0bf6f8e44dde3a092cec1d5 Mon Sep 17 00:00:00 2001 From: brijeshkrishnan Date: Thu, 28 Nov 2024 09:14:29 +0530 Subject: [PATCH] updated the cloc to generate cmd file compatible with mac --- eaglevision/cloc_eagle.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/eaglevision/cloc_eagle.py b/eaglevision/cloc_eagle.py index 2bfa1d4..14212a6 100644 --- a/eaglevision/cloc_eagle.py +++ b/eaglevision/cloc_eagle.py @@ -29,8 +29,14 @@ def __cmd_builder(self): def __write_cmd(self): """ Function to create a batch file to execute cloc """ file_out = open(os.path.join(self.report_path, "cloc.cmd"), "w") + is_windows = sys.platform.startswith('win') + if not is_windows: + file_out.write("#! /bin/bash") + file_out.write("\n") file_out.write(self.cmd) file_out.close() + if not is_windows: + os.system("chmod +x %s"%os.path.join(self.report_path, "cloc.cmd")) def __subprocess_out(self): """ Function to execute cloc command """