From 4ddbdc61a3ec2959601f440c329bc8a180016f35 Mon Sep 17 00:00:00 2001 From: Peter Mikola Date: Fri, 6 Dec 2024 16:57:30 +0100 Subject: [PATCH] tweak mach files a little bit (#34485) Signed-off-by: Peter MIKOLA --- mach | 8 +------- mach.bat | 5 +++-- 2 files changed, 4 insertions(+), 9 deletions(-) diff --git a/mach b/mach index 2ff80f6b51d..aa21bcef4f0 100755 --- a/mach +++ b/mach @@ -1,14 +1,8 @@ -#!/bin/sh +#!/usr/bin/env python3 # This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at https://mozilla.org/MPL/2.0/. -# The beginning of this script is both valid shell and valid python, -# such that the script starts with the shell and is reexecuted with -# the right python. -''':' && if [ ! -z "$MSYSTEM" ] ; then exec python "$0" "$@" ; else which python3 > /dev/null 2> /dev/null && exec python3 "$0" "$@" || exec python "$0" "$@" ; fi -''' - import os import sys diff --git a/mach.bat b/mach.bat index 2e76ecf92bc..d9047a1424b 100644 --- a/mach.bat +++ b/mach.bat @@ -1,8 +1,9 @@ @echo off +set workdir=%~dp0 where /Q py.exe IF %ERRORLEVEL% NEQ 0 ( - python mach %* + python %workdir%mach %* ) ELSE ( - py -3 mach %* + py -3 %workdir%mach %* )