File tree Expand file tree Collapse file tree 2 files changed +24
-13
lines changed
photonlib-python-examples Expand file tree Collapse file tree 2 files changed +24
-13
lines changed Original file line number Diff line number Diff line change 11@ echo off
22setlocal
33
4- :: Check if the first argument is provided
5- if " %~1 " == " " (
6- echo Error: No example-to-run provided.
7- exit /b 1
8- )
9-
104:: To run any example, we want to use photonlib out of the source code in this repo.
115:: Build the wheel first
126pushd %~dp0 ..\photon-lib\py
1812set PHOTONLIBPY_ROOT = %~dp0 ..\photon-lib\py
1913set PYTHONPATH = %PHOTONLIBPY_ROOT%
2014
15+ :: If an example to run is not provided, run all examples
16+ if " %~1 " == " " (
17+ echo No example provided, running all examples
18+ for /D %%d in (*) do (
19+ if (not " %%d " == " ." if not " %%d " == " .." ) (
20+ echo Running example in %%d
21+ call " %~dp0 run.bat" " %%d "
22+ )
23+ )
24+ exit /b 0
25+ )
26+
2127:: Move to to the right example folder
2228cd %~1
2329
Original file line number Diff line number Diff line change 1- # Check if the first argument is provided
2- if [ $# -eq 0 ]
3- then
4- echo " Error: No example-to-run provided."
5- exit 1
6- fi
7-
81# To run any example, we want to use photonlib out of this repo
92# Build the wheel first
103pushd ../photon-lib/py
1811export PHOTONLIBPY_ROOT=../photon-lib/py
1912export PYTHONPATH=$PHOTONLIBPY_ROOT
2013
14+ # If an example to run is not provided, run all examples
15+ if [ $# -eq 0 ]
16+ then
17+ echo " No example provided, running all examples"
18+ for dir in * /
19+ do
20+ echo " Running example in $dir "
21+ ./run.sh $dir
22+ done
23+ exit 0
24+ fi
25+
2126# Move to the right example folder
2227cd $1
2328
You can’t perform that action at this time.
0 commit comments