Add action to copy chromedriver.
This commit is contained in:
parent
88269a613a
commit
cba155bcfb
2 changed files with 42 additions and 0 deletions
30
atom.gyp
30
atom.gyp
|
@ -688,6 +688,36 @@
|
||||||
}], # OS=="linux"
|
}], # OS=="linux"
|
||||||
],
|
],
|
||||||
}, # target <(project_name>_dump_symbols
|
}, # target <(project_name>_dump_symbols
|
||||||
|
{
|
||||||
|
'target_name': 'copy_chromedriver',
|
||||||
|
'type': 'none',
|
||||||
|
'actions': [
|
||||||
|
{
|
||||||
|
'action_name': 'Copy ChromeDriver Binary',
|
||||||
|
'variables': {
|
||||||
|
'conditions': [
|
||||||
|
['OS=="win"', {
|
||||||
|
'chromedriver_binary': 'chromedriver.exe',
|
||||||
|
},{
|
||||||
|
'chromedriver_binary': 'chromedriver',
|
||||||
|
}],
|
||||||
|
],
|
||||||
|
},
|
||||||
|
'inputs': [
|
||||||
|
'<(libchromiumcontent_library_dir)/<(chromedriver_binary)',
|
||||||
|
],
|
||||||
|
'outputs': [
|
||||||
|
'<(PRODUCT_DIR)/<(chromedriver_binary)',
|
||||||
|
],
|
||||||
|
'action': [
|
||||||
|
'python',
|
||||||
|
'tools/copy_binary.py',
|
||||||
|
'<@(_inputs)',
|
||||||
|
'<@(_outputs)',
|
||||||
|
],
|
||||||
|
}
|
||||||
|
],
|
||||||
|
}, # copy_chromedriver
|
||||||
],
|
],
|
||||||
'conditions': [
|
'conditions': [
|
||||||
['OS=="mac"', {
|
['OS=="mac"', {
|
||||||
|
|
12
tools/copy_binary.py
Executable file
12
tools/copy_binary.py
Executable file
|
@ -0,0 +1,12 @@
|
||||||
|
#!/usr/bin/env python
|
||||||
|
|
||||||
|
import os
|
||||||
|
import shutil
|
||||||
|
import stat
|
||||||
|
import sys
|
||||||
|
|
||||||
|
src = sys.argv[1]
|
||||||
|
dist = sys.argv[2]
|
||||||
|
|
||||||
|
shutil.copyfile(src, dist)
|
||||||
|
os.chmod(dist, os.stat(dist).st_mode | stat.S_IEXEC)
|
Loading…
Add table
Add a link
Reference in a new issue