depot/third_party/nixpkgs/pkgs/development/python-modules/opensfm/fix-scripts.patch
Default email 8e65f7f0cc Project import generated by Copybara.
GitOrigin-RevId: 062a0c5437b68f950b081bbfc8a699d57a4ee026
2022-03-05 17:20:37 +01:00

41 lines
912 B
Diff

diff --git a/bin/opensfm b/bin/opensfm
index b5ee4b15..f05c0d1c 100755
--- a/bin/opensfm
+++ b/bin/opensfm
@@ -1,12 +1,6 @@
-#!/bin/bash
+#!/usr/bin/env bash
set -e
DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
-if [ -x "$(command -v python3)" ]; then
- PYTHON=python3
-else
- PYTHON=python
-fi
-
-"$PYTHON" "$DIR"/opensfm_main.py "$@"
+exec "$DIR"/opensfm_main.py "$@"
diff --git a/bin/opensfm_main.py b/bin/opensfm_main.py
index 31249e12..cc71560c 100755
--- a/bin/opensfm_main.py
+++ b/bin/opensfm_main.py
@@ -1,3 +1,5 @@
+#!/usr/bin/env python
+
import sys
from os.path import abspath, join, dirname
diff --git a/setup.py b/setup.py
index 1120717f..438a16db 100644
--- a/setup.py
+++ b/setup.py
@@ -71,6 +71,7 @@ setuptools.setup(
scripts=[
"bin/opensfm_run_all",
"bin/opensfm",
+ "bin/opensfm_main.py",
],
package_data={
"opensfm": [