leanflutter / flutter_distributor

An all-in-one Flutter application packaging and distribution tool, providing you with a one-stop solution to meet various distribution needs.
https://distributor.leanflutter.dev/
MIT License
763 stars 104 forks source link

Fixing spaces in paths #177

Closed abdelaziz-mahdy closed 2 months ago

abdelaziz-mahdy commented 2 months ago

in macos if path has spaces in it the files doesnt get copied

image

so this adds qoutes to command to fix the path space getting escaped

vercel[bot] commented 2 months ago

The latest updates on your projects. Learn more about Vercel for Git ↗︎

1 Ignored Deployment | Name | Status | Preview | Comments | Updated (UTC) | | :--- | :----- | :------ | :------- | :------ | | **flutter-distributor-website** | ⬜️ Ignored ([Inspect](https://vercel.com/jianyinglis-projects/flutter-distributor-website/CJp38iJJEyE8izCgEas7L6VUmoeD)) | [Visit Preview](https://flutter-distributor-website-git-for-9029be-jianyinglis-projects.vercel.app) | | Apr 16, 2024 11:02pm |
abdelaziz-mahdy commented 2 months ago

i cant find a way to test if this fix worked or not, so if it worked i would if it can be merged

i renamed my app using https://pub.dev/packages/package_rename if it helps

lijy91 commented 2 months ago

I think you should modify the file name in make_config.yaml as follows

title: hello_world
contents:
  - x: 448
    y: 344
    type: link
    path: "/Applications"
  - x: 192
    y: 344
    type: file
-    path: anime_Hhere.app
+    path: "Anime Here.app"

My log:


===> Releasing dev-release:macos-dmg
Packaging hello_world 1.0.0+1 as dmg:
$ /Users/lijy91/fvm/versions/3.16.5/bin/flutter build macos --dart-define-from-file env.json --dart-define FLUTTER_BUILD_NAME=1.0.0 --dart-define FLUTTER_BUILD_NUMBER=1

Building macOS application...                                   
--- xcodebuild: WARNING: Using the first of multiple matching destinations:
{ platform:macOS, arch:arm64, id:00006000-0004199C0A22401E, name:My Mac }
{ platform:macOS, arch:x86_64, id:00006000-0004199C0A22401E, name:My Mac }
{
  "config": {
    "mode": "release",
    "arguments": {
      "dart-define-from-file": "env.json"
    }
  },
  "outputDirectory": "build/macos/Build/Products/Release",
  "duration": 5187,
  "outputFiles": [
    "./build/macos/Build/Products/Release/Hello World.app"
  ]
}
Successfully built Directory: 'build/macos/Build/Products/Release' in 5s
$ cp -RH build/macos/Build/Products/Release/Hello World.app dist/1.0.0+1/hello_world-1.0.0+1-macos_dmg
$ cp -RH macos/packaging/dmg/. dist/1.0.0+1/hello_world-1.0.0+1-macos_dmg
$ appdmg dist/1.0.0+1/hello_world-1.0.0+1-macos_dmg/make_config.json dist/1.0.0+1/hello_world-1.0.0+1-macos.dmg
[ 1/21] Looking for target...                [ OK ]
[ 2/21] Reading JSON Specification...        [ OK ]
[ 3/21] Parsing JSON Specification...        [ OK ]
[ 4/21] Validating JSON Specification...     [ OK ]
[ 5/21] Looking for files...                 [ OK ]
[ 6/21] Calculating size of image...         [ OK ]
[ 7/21] Creating temporary image...          [ OK ]
[ 8/21] Mounting temporary image...          [ OK ]
[ 9/21] Making hidden background folder...   [ OK ]
[10/21] Copying background...                [SKIP]
[11/21] Reading background dimensions...     [SKIP]
[12/21] Copying icon...                      [SKIP]
[13/21] Setting icon...                      [SKIP]
[14/21] Creating links...                    [ OK ]
[15/21] Copying files...                     [ OK ]
[16/21] Making all the visuals...            [ OK ]
[17/21] Blessing image...                    [ OK ]
[18/21] Unmounting temporary image...        [ OK ]
[19/21] Finalizing image...                  [ OK ]
[20/21] Signing image...                     [SKIP]
[21/21] Removing temporary image...          [ OK ]
[22/21] Removing target image...             [ OK ]

Your image is ready:
dist/1.0.0+1/hello_world-1.0.0+1-macos.dmg
{
  "config": {
    "title": "hello_world",
    "contents": [
      {
        "x": 448,
        "y": 344,
        "type": "link",
        "path": "/Applications"
      },
      {
        "x": 192,
        "y": 344,
        "type": "file",
        "path": "Hello World.app"
      }
    ]
  },
  "artifacts": [
    {
      "type": "file",
      "path": "dist/1.0.0+1/hello_world-1.0.0+1-macos.dmg"
    }
  ]
}
Successfully packaged dist/1.0.0+1/hello_world-1.0.0+1-macos.dmg

RELEASE SUCCESSFUL in 10s
abdelaziz-mahdy commented 2 months ago

thank you having the path as you mentioned worked perfectly

  # path: anime_here.app
  path: "Anime Here.app"