瀏覽代碼

Workaround snapcraft container quirks

bryan 1 周之前
父節點
當前提交
199fd942fb
共有 1 個文件被更改,包括 4 次插入1 次删除
  1. 4 1
      installJRMC

+ 4 - 1
installJRMC

@@ -1128,12 +1128,15 @@ install_mc_snap() {
   echo "snapcraft.yaml created at $snap_yaml"
   echo "Building snap package..."
 
+  # Be careful with snapcraft container paths
+  # The container does not respect the --workdir
+  # Also has incompatible --entrypoint so need to override manually
   if execute podman run --rm -it \
     -v "$OUTPUT_DIR:/build:Z" \
     -w /build \
     --entrypoint "" \
     ghcr.io/canonical/snapcraft:8_core24 \
-    snapcraft pack -o "${MC_PKG}_${MC_VERSION}-${MC_RELEASE}.snap" --destructive-mode \
+    snapcraft pack -o "/build/${MC_PKG}_${MC_VERSION}-${MC_RELEASE}.snap" --destructive-mode \
     && [[ -f "$snap_dir/${MC_PKG}_${MC_VERSION}-${MC_RELEASE}.snap" ]]; then
       echo "Snap package built successfully: $snap_dir/${MC_PKG}_${MC_VERSION}-${MC_RELEASE}.snap"
   else