File tree Expand file tree Collapse file tree 2 files changed +24
-6
lines changed Expand file tree Collapse file tree 2 files changed +24
-6
lines changed Original file line number Diff line number Diff line change @@ -43,11 +43,20 @@ if(-Not (Test-Path -Path "$output_dir")) {
43
43
& " $unity_path " - version | Tee-Object - Variable unity_version | Out-Null
44
44
45
45
if ($unity_version -match ' ^[0-9]{4}\.[0-9]*\.[0-9]*[f]?[0-9]*$' ) {
46
- Write-Host " Unity editor confirmed... "
46
+ Write-Host " Unity editor confirmed."
47
47
} else {
48
- Write-Host " Can't confirm Unity editor. Exiting."
49
- exit 1
48
+ while (1 ) {
49
+ $confirmation = Read-Host " Can't confirm Unity editor. Do you want to force $unity_path as an Unity editor executable? [y]es or [n]o"
50
+ if ($confirmation -eq ' y' -or $confirmation -eq ' Y' ) {
51
+ break ;
52
+ } elseif ( $confirmation -eq ' n' -or $confirmation -eq ' N' ) {
53
+ exit 1 ;
54
+ } else {
55
+ Write-Host " Please answer [y]es or [n]o." ;
56
+ }
57
+ }
50
58
}
59
+ Write-Host " Using ${unity_path} editor."
51
60
52
61
$tmp_project_path = Join-Path - Path " $temp_dir " - ChildPath " \ros2cs_unity_project\$unity_version "
53
62
Original file line number Diff line number Diff line change @@ -71,12 +71,21 @@ UNITY_VERSION=`$UNITY_PATH -version`
71
71
72
72
# Test if unity editor is valid
73
73
if [[ $UNITY_VERSION =~ ^[0-9]{4}\. [0-9]* \. [0-9]* [f]? [0-9]* $ ]]; then
74
- echo " Unity editor confirmed... "
74
+ echo " Unity editor confirmed."
75
75
else
76
- echo " Can't confirm Unity editor. Exiting."
77
- exit 1
76
+ while true ; do
77
+ read -p " Can't confirm Unity editor. Do you want to force \" $UNITY_PATH \" as an Unity editor executable? [y]es or [N]o: " yn
78
+ yn=${yn:- " n" }
79
+ case $yn in
80
+ [Yy]* ) break ;;
81
+ [Nn]* ) exit 1;;
82
+ * ) echo " Please answer [y]es or [n]o." ;;
83
+ esac
84
+ done
78
85
fi
79
86
87
+ echo " Using \" ${UNITY_PATH} \" editor."
88
+
80
89
TMP_PROJECT_PATH=/tmp/ros2cs_unity_project/$UNITY_VERSION
81
90
# Create temp project
82
91
if [ -d " $TMP_PROJECT_PATH " ]; then
You can’t perform that action at this time.
0 commit comments