mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 17:59:23 -04:00
* [Reporting] code cleanup for reporting browser setup utilities * fix target_cpu * Update README.md * Update README.md * add note about target_cpu * Update paths.ts * more cleanup * Update src/dev/chromium_version.ts Co-authored-by: Michael Dokolin <dokmic@gmail.com> * remove bug Co-authored-by: Michael Dokolin <dokmic@gmail.com> Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
29 lines
812 B
Python
29 lines
812 B
Python
import os, hashlib, platform, sys
|
|
|
|
# This file contains various utility functions used by the init and build scripts
|
|
|
|
def runcmdsilent(cmd):
|
|
"""Executes a string command in the shell"""
|
|
print(' > ' + cmd)
|
|
return os.system(cmd)
|
|
|
|
def runcmd(cmd):
|
|
"""Executes a string command in the shell"""
|
|
print(' > ' + cmd)
|
|
result = os.system(cmd)
|
|
if result != 0:
|
|
raise Exception(cmd + ' returned ' + str(result))
|
|
|
|
def mkdir(dir):
|
|
print(' > mkdir -p ' + dir)
|
|
"""Makes a directory if it doesn't exist"""
|
|
if not os.path.exists(dir):
|
|
return os.makedirs(dir)
|
|
|
|
def md5_file(filename):
|
|
"""Builds a hex md5 hash of the given file"""
|
|
md5 = hashlib.md5()
|
|
with open(filename, 'rb') as f:
|
|
for chunk in iter(lambda: f.read(128 * md5.block_size), b''):
|
|
md5.update(chunk)
|
|
return md5.hexdigest()
|