-
Notifications
You must be signed in to change notification settings - Fork 7
/
+install-release.py
executable file
·47 lines (42 loc) · 1.31 KB
/
+install-release.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#! /usr/bin/env python3
# -*- coding: UTF-8 -*-
#------------------------------------------------------------------------------
import sys, os, subprocess
#------------------------------------------------------------------------------
#--- Get script absolute path
scriptDir = os.path.dirname (os.path.abspath (sys.argv [0]))
os.chdir (scriptDir)
#---
runInit = False
if not os.path.exists ("build") :
runInit = True
returncode = subprocess.call (["mkdir", "build"])
if returncode != 0 :
sys.exit (returncode)
#--- Change directory
os.chdir ("build")
#--- Run init
if runInit :
result = subprocess.call (["cmake", ".."])
if returncode != 0 :
sys.exit (returncode)
#--- Build Analyzer
returncode = subprocess.call (["cmake", "--build", "."])
if returncode != 0 :
sys.exit (returncode)
#--- Copy analyzer
returnCode = subprocess.call ([
"cp",
"Analyzers/libCANFDMolinaroAnalyzer.so",
os.path.expanduser ("~/Documents/customSaleaeLogicAnalyzers")
])
if returncode != 0 :
sys.exit (returncode)
#--- Remove attributes
returnCode = subprocess.call ([
"xattr", "-r", "-d", "com.apple.quarantine",
os.path.expanduser ("~/Documents/customSaleaeLogicAnalyzers/libCANFDMolinaroAnalyzer.so")
])
if returncode != 0 :
sys.exit (returncode)
#------------------------------------------------------------------------------