Skip to content

Commit 0552e15

Browse files
authored
Skip AssertInitialized for darwin-dmg (#102)
1 parent 4b35141 commit 0552e15

File tree

3 files changed

+7
-1
lines changed

3 files changed

+7
-1
lines changed

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ cd into a flutter project.
4343
cd projects/simpleApplication
4444
```
4545

46-
The first time you use hover for a project, you'll need to initialize the project for desktop. An argument can be passed to `hover init` to set the project path. This is usually the path for your project on github or a self-hosted git service. _If you are unsure, use `hover init`, the generated path can always be changed later._
46+
The first time you use hover for a project, you'll need to initialize the project for use with hover. An argument can be passed to `hover init` to set the project path. This is usually the path for your project on github or a self-hosted git service. _If you are unsure use `hover init` without a path. You can change the path later._
4747

4848
```bash
4949
hover init github.com/my-organization/simpleApplication
@@ -55,6 +55,7 @@ Make sure you have the following
5555
[main_desktop.dart](https://github.com/go-flutter-desktop/examples/blob/5508a59ff4916fca9c05dfde4929d8848fd2a947/pointer_demo/lib/main_desktop.dart)
5656
in the root librairie of your application.
5757
It's the following code before `runApp(..)` that makes Flutter run on other platforms:
58+
5859
```dart
5960
debugDefaultTargetPlatformOverride = TargetPlatform.fuchsia;
6061
```

cmd/packaging/darwin-dmg.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,5 @@ var DarwinDmgTask = &packagingTask{
99
packagingScriptTemplate: "ln -sf /Applications dmgdir/Applications && genisoimage -V '{{.projectName}}' -D -R -apple -no-pad -o '{{.projectName}}-{{.version}}.dmg' dmgdir",
1010
outputFileExtension: "dmg",
1111
outputFileContainsVersion: true,
12+
skipAssertInitialized: true,
1213
}

cmd/packaging/packaging.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,7 @@ type packagingTask struct {
126126
packagingScriptTemplate string // Template for the command that actually packages the app
127127
outputFileExtension string // File extension of the packaged app
128128
outputFileContainsVersion bool // Whether the output file name contains the version
129+
skipAssertInitialized bool // Set to true when a task doesn't need to be initialized.
129130
}
130131

131132
func (t *packagingTask) Name() string {
@@ -232,6 +233,9 @@ func (t *packagingTask) Pack(buildVersion string) {
232233
}
233234

234235
func (t *packagingTask) AssertInitialized() {
236+
if t.skipAssertInitialized {
237+
return
238+
}
235239
if !t.IsInitialized() {
236240
log.Errorf("%s is not initialized for packaging. Please run `hover init-packaging %s` first.", t.packagingFormatName, t.packagingFormatName)
237241
os.Exit(1)

0 commit comments

Comments
 (0)