From 67c81e8eb41b01db46bb5a94dc474873922ee92b Mon Sep 17 00:00:00 2001 From: eeff <33566201+eeff@users.noreply.github.com> Date: Wed, 24 Aug 2022 11:53:49 +0800 Subject: [PATCH] fix: migrate.py to support both python and python3 --- migrate.py | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/migrate.py b/migrate.py index 56727ddc..1a0a3274 100755 --- a/migrate.py +++ b/migrate.py @@ -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