Explorar el Código

Moved functions to top

Joachim M. Giæver hace 5 años
padre
commit
5e0698081e
Se han modificado 1 ficheros con 16 adiciones y 16 borrados
  1. 16 16
      bin/lxcbuild

+ 16 - 16
bin/lxcbuild

@@ -18,22 +18,6 @@ function cprint {
 	done < <(printf "%s\n" "${2}")
 }
 
-
-if [ "${CONTAINER_NAME}" != "$(basename $(pwd))" ]; then
-	cprint "err" "Run script from root folder of project"
-	exit 1
-fi
-
-CURRF="$(md5sum "${0}")"
-
-git pull
-
-if [ "${CURRF}" != "$(md5sum "${0}")" ]; then
-	cprint "File changes on last pull. Restarting..."
-	${SELF}
-	exit 1
-fi
-
 function container_sh {
 	if [ $# -eq 1 ]; then
 		cprint "info" "${1}"
@@ -115,6 +99,22 @@ function init_container {
 	return 0;
 }
 
+if [ "${CONTAINER_NAME}" != "$(basename $(pwd))" ]; then
+	cprint "err" "Run script from root folder of project"
+	exit 1
+fi
+
+CURRF="$(md5sum "${0}")"
+
+git pull
+
+if [ "${CURRF}" != "$(md5sum "${0}")" ]; then
+	cprint "File changes on last pull. Restarting..."
+	${SELF}
+	exit 1
+fi
+
+
 check_installed "dpkg" "snapd"
 check_installed "snap" "lxd"
 init_container