mirror of
https://github.com/fastogt/pyfastogt
synced 2025-03-09 23:38:55 +00:00
force symlink
This commit is contained in:
parent
607e77b2d0
commit
2a838e7a31
2 changed files with 15 additions and 4 deletions
|
@ -1,7 +1,6 @@
|
|||
#!/usr/bin/env python
|
||||
|
||||
import platform
|
||||
import re
|
||||
import subprocess
|
||||
from abc import ABCMeta, abstractmethod
|
||||
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
#!/usr/bin/env python
|
||||
|
||||
import errno
|
||||
import os
|
||||
import re
|
||||
import shutil
|
||||
|
@ -136,3 +137,14 @@ def git_clone(url, current_dir):
|
|||
common_git_clone_init_line = ['git', 'submodule', 'update', '--init', '--recursive']
|
||||
subprocess.call(common_git_clone_init_line)
|
||||
return os.path.join(current_dir, cloned_dir)
|
||||
|
||||
|
||||
def symlink_force(target, link_name):
|
||||
try:
|
||||
os.symlink(target, link_name)
|
||||
except OSError as e:
|
||||
if e.errno == errno.EEXIST:
|
||||
os.remove(link_name)
|
||||
os.symlink(target, link_name)
|
||||
else:
|
||||
raise e
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue