Browse Source

Fixed to many arg error

Joachim M. Giæver 5 years ago
parent
commit
77604637d0
1 changed files with 2 additions and 3 deletions
  1. 2 3
      bin/lxcbuild

+ 2 - 3
bin/lxcbuild

@@ -24,7 +24,7 @@ function cprint {
 }
 }
 
 
 function container_sh {
 function container_sh {
-	if [ $# -eq 1 ]; then
+	if [ $# -eq 1 ]; then
 		cprint "info" "${1}"
 		cprint "info" "${1}"
 	fi
 	fi
 	lxc exec ${CONTAINER_NAME} -- sh -c "${1}"
 	lxc exec ${CONTAINER_NAME} -- sh -c "${1}"
@@ -143,9 +143,8 @@ else
 fi
 fi
 
 
 cprint "info" "Building snap"
 cprint "info" "Building snap"
-
 RET=-1
 RET=-1
-if [ $(container_snap_sh "ls | grep prime | wc -l") -ne 0 ]; then
+if [ "$(container_sh "ls $(container_home)/${CONTAINER_NAME} | grep prime | wc -l")" == "1" ]; then
 	container_snap_sh "snapcraft prime --destructive-mode"
 	container_snap_sh "snapcraft prime --destructive-mode"
 	if [ $? -ne 0 ]; then
 	if [ $? -ne 0 ]; then
 		container_snap_sh "snapcraft clean --destructive-mode"
 		container_snap_sh "snapcraft clean --destructive-mode"