fix: migrate.py to support both python and python3

This commit is contained in:
eeff
2022-08-24 11:53:49 +08:00
parent 6beffed3e6
commit 67c81e8eb4
+14 -1
View File
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/bin/sh
#
# NEURON IIoT System for Industry 4.0
# Copyright (C) 2020-2022 EMQ Technologies Co., Ltd All rights reserved.
@@ -18,6 +18,19 @@
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
"""":
if type python3 > /dev/null 2>&1
then
exec python3 "$0" "$@"
elif type python > /dev/null 2>&1
then
exec python "$0" "$@"
else
echo >&2 "Python not installed"
fi
exit 1
""" # """
from __future__ import print_function
import argparse