import os import platform def main(): # Build executable and create bin/ os.system("cargo build --release") if not os.path.exists("bin"): os.mkdir("bin") # Move executable to bin/ if platform.system() == 'Windows': if not os.path.isfile("bin/seher.exe"): os.remove("bin/seher.exe") os.rename("target/release/r-seher.exe", "bin/seher.exe") else: if not os.path.isfile("bin/seher"): os.remove("bin/seher") os.rename("target/release/r-seher", "bin/seher") # Run if main file if __name__ == "__main__": main()