aboutsummaryrefslogtreecommitdiffstats
path: root/build/scripts/symlink.py
diff options
context:
space:
mode:
authoralexv-smirnov <alex@ydb.tech>2023-06-13 11:05:01 +0300
committeralexv-smirnov <alex@ydb.tech>2023-06-13 11:05:01 +0300
commitbf0f13dd39ee3e65092ba3572bb5b1fcd125dcd0 (patch)
tree1d1df72c0541a59a81439842f46d95396d3e7189 /build/scripts/symlink.py
parent8bfdfa9a9bd19bddbc58d888e180fbd1218681be (diff)
downloadydb-bf0f13dd39ee3e65092ba3572bb5b1fcd125dcd0.tar.gz
add ymake export to ydb
Diffstat (limited to 'build/scripts/symlink.py')
-rwxr-xr-xbuild/scripts/symlink.py29
1 files changed, 29 insertions, 0 deletions
diff --git a/build/scripts/symlink.py b/build/scripts/symlink.py
new file mode 100755
index 0000000000..9e30a25065
--- /dev/null
+++ b/build/scripts/symlink.py
@@ -0,0 +1,29 @@
+#!/usr/bin/env python
+
+import sys
+import os
+import platform
+from subprocess import call
+
+
+def symlink():
+ if len(sys.argv) < 3:
+ print >>sys.stderr, "Usage: symlink.py <source> <target>"
+ sys.exit(1)
+
+ source = sys.argv[1]
+ target = sys.argv[2]
+
+ print("Making a symbolic link from {0} to {1}".format(source, target))
+
+ sysName = platform.system()
+ if sysName == "Windows": # and not os.path.exists(target)
+ if os.path.isdir(source):
+ call(["mklink", "/D", target, source], shell=True)
+ else:
+ call(["mklink", target, source], shell=True)
+ else:
+ call(["ln", "-f", "-s", "-n", source, target])
+
+if __name__ == '__main__':
+ symlink()