Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
tools
githooks
setup.py
Go to the documentation of this file.
1
#!/usr/bin/env python3
2
# Copyright 2013 The Flutter Authors. All rights reserved.
3
# Use of this source code is governed by a BSD-style license that can be
4
# found in the LICENSE file.
5
6
'''
7
Sets up githooks.
8
'''
9
10
import
os
11
import
subprocess
12
import
sys
13
14
SRC_ROOT = os.path.dirname(
15
os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
16
)
17
FLUTTER_DIR = os.path.join(SRC_ROOT,
'flutter'
)
18
19
20
def
IsWindows
():
21
os_id = sys.platform
22
return
os_id.startswith(
'win32'
)
or
os_id.startswith(
'cygwin'
)
23
24
25
def
Main
(argv):
26
git =
'git'
27
githooks = os.path.join(FLUTTER_DIR,
'tools'
,
'githooks'
)
28
if
IsWindows
():
29
git =
'git.bat'
30
result = subprocess.run([
31
git,
32
'config'
,
33
'core.hooksPath'
,
34
githooks,
35
], cwd=FLUTTER_DIR)
36
return
result.returncode
37
38
39
if
__name__ ==
'__main__'
:
40
sys.exit(
Main
(sys.argv))
setup.IsWindows
IsWindows()
Definition
setup.py:20
setup.Main
Main(argv)
Definition
setup.py:25
Generated on Fri Apr 26 2024 06:18:17 for Flutter Engine by
1.9.8