Browse Source

Intermediate changes

robot-piglet 1 year ago
parent
commit
6a2538ba9f
1 changed files with 19 additions and 1 deletions
  1. 19 1
      ya

+ 19 - 1
ya

@@ -1,7 +1,25 @@
-#!/usr/bin/env python
+#!/usr/bin/env sh
 
 # Please, keep this script in sync with arcadia/ya
 
+# Shell commands follow
+# Next line is bilingual: it starts a comment in Python, but do nothing in shell
+""":"
+
+# Find a suitable python interpreter
+for cmd in python3 python; do
+    command -v > /dev/null $cmd && exec `command -v $cmd` $0 "$@"
+done
+
+echo "Python interpreter is not found in this system, please, install python" >&2
+
+exit 2
+
+":"""
+# Previous line is bilingual: it ends a comment in Python, but do nothing in shell
+# Shell commands end here
+# Python script follows
+
 import os
 import sys
 import platform