├── .gitignore ├── .gon.hcl ├── .goreleaser.yml ├── LICENSE ├── Makefile ├── README.md ├── cmd └── gon │ ├── item.go │ ├── main.go │ └── status_human.go ├── go.mod ├── go.sum ├── internal ├── config │ ├── config.go │ ├── parse.go │ ├── parse_test.go │ └── testdata │ │ ├── basic.hcl │ │ ├── basic.hcl.golden │ │ ├── entitle.hcl │ │ ├── entitle.hcl.golden │ │ ├── env_appleid.hcl │ │ ├── env_appleid.hcl.golden │ │ ├── notarize.hcl │ │ ├── notarize.hcl.golden │ │ ├── notarize_multiple.hcl │ │ └── notarize_multiple.hcl.golden └── createdmg │ ├── bindata │ ├── bindata.go │ └── generate.go │ ├── createdmg.go │ └── createdmg_test.go ├── notarize ├── error.go ├── info.go ├── info_test.go ├── log.go ├── log_test.go ├── notarize.go ├── notarize_test.go ├── status.go ├── upload.go └── upload_test.go ├── package ├── dmg │ └── dmg.go └── zip │ └── zip.go ├── sign ├── sign.go ├── sign_children_test.go └── sign_test.go ├── staple └── staple.go └── vendor ├── README.md └── create-dmg ├── .gitignore ├── LICENSE ├── README.md ├── builder └── create-dmg.builder ├── create-dmg ├── sample └── support ├── brew-me.sh ├── dmg-license.py └── template.applescript /.gitignore: -------------------------------------------------------------------------------- 1 | cmd/gon/gon 2 | dist/ 3 | 4 | # For testing: 5 | config.hcl 6 | -------------------------------------------------------------------------------- /.gon.hcl: -------------------------------------------------------------------------------- 1 | source = ["./dist/macos_darwin_amd64/gon"] 2 | bundle_id = "com.mitchellh.gon" 3 | 4 | apple_id { 5 | username = "mitchell.hashimoto@gmail.com" 6 | password = "@env:AC_PASSWORD" 7 | provider = "UL304B4VGY" 8 | } 9 | 10 | sign { 11 | application_identity = "97E4A93EAA8BAC7A8FD2383BFA459D2898100E56" 12 | } 13 | 14 | zip { 15 | output_path = "./dist/gon_macos.zip" 16 | } 17 | 18 | dmg { 19 | output_path = "./dist/gon_macos.dmg" 20 | volume_name = "gon" 21 | } 22 | -------------------------------------------------------------------------------- /.goreleaser.yml: -------------------------------------------------------------------------------- 1 | env: 2 | - GO111MODULE=on 3 | 4 | before: 5 | hooks: 6 | - go mod download 7 | 8 | builds: 9 | - id: macos 10 | env: 11 | - CGO_ENABLED=0 12 | goos: 13 | - darwin 14 | goarch: 15 | - amd64 16 | dir: ./cmd/gon/ 17 | 18 | archives: 19 | - id: macos-zip 20 | format: zip 21 | name_template: "{{ .ProjectName }}_{{ .Os }}" 22 | replacements: 23 | darwin: macos 24 | amd64: x86_64 25 | 26 | checksum: 27 | disable: true 28 | 29 | signs: 30 | - signature: "${artifact}_macos.dmg" 31 | ids: 32 | - macos-zip 33 | cmd: gon 34 | args: 35 | - .gon.hcl 36 | artifacts: all 37 | 38 | snapshot: 39 | name_template: "{{ .Tag }}-next" 40 | 41 | changelog: 42 | sort: asc 43 | filters: 44 | exclude: 45 | - 'README' 46 | 47 | release: 48 | ids: 49 | - none 50 | extra_files: 51 | - glob: ./dist/gon_macos.dmg 52 | - glob: ./dist/gon_macos.zip 53 | 54 | brews: 55 | - tap: 56 | owner: mitchellh 57 | name: homebrew-gon 58 | description: "Sign, notarize, and package macOS CLI applications written in any language." 59 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2019 Mitchell Hashimoto 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | # release will package the distribution packages, sign, and notarize. It 2 | # will then upload the release to GitHub and publish the Homebrew tap. 3 | # 4 | # AFTER THIS YOU MUST MANUALLY DELETE the checksums.txt file since it is 5 | # incomplete and we don't need checksums since our artifacts are signed. 6 | release: 7 | goreleaser --rm-dist 8 | .PHONY: release 9 | 10 | clean: 11 | rm -rf dist/ 12 | .PHONY: clean 13 | 14 | # Update the TOC in the README. 15 | readme/toc: 16 | doctoc --notitle README.md 17 | .PHONY: readme/toc 18 | 19 | vendor: vendor/create-dmg 20 | 21 | vendor/create-dmg: 22 | rm -rf vendor/create-dmg 23 | git clone https://github.com/andreyvit/create-dmg vendor/create-dmg 24 | rm -rf vendor/create-dmg/.git 25 | 26 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | **Archived:** I unfortunately no longer make active use of this project 2 | and haven't properly maintained it since early 2022. I welcome anyone to 3 | fork and take over this project. 4 | 5 | ----------------------------------------------------- 6 | 7 | # gon - CLI and Go Library for macOS Notarization 8 | 9 | gon is a simple, no-frills tool for 10 | [signing and notarizing](https://developer.apple.com/developer-id/) 11 | your CLI binaries for macOS. gon is available as a CLI that can be run 12 | manually or in automation pipelines. It is also available as a Go library for 13 | embedding in projects written in Go. gon can sign and notarize binaries written 14 | in any language. 15 | 16 | Beginning with macOS Catalina (10.15), Apple is 17 | [requiring all software distributed outside of the Mac App Store to be signed and notarized](https://developer.apple.com/news/?id=10032019a). 18 | Software that isn't properly signed or notarized will be shown an 19 | [error message](https://github.com/hashicorp/terraform/issues/23033) 20 | with the only actionable option being to "Move to Bin". The software cannot 21 | be run even from the command-line. The 22 | [workarounds are painful for users](https://github.com/hashicorp/terraform/issues/23033#issuecomment-542302933). 23 | gon helps you automate the process of notarization. 24 | 25 | 26 | 27 | 28 | 29 | - [Features](#features) 30 | - [Example](#example) 31 | - [Installation](#installation) 32 | - [Usage](#usage) 33 | - [Prerequisite: Acquiring a Developer ID Certificate](#prerequisite-acquiring-a-developer-id-certificate) 34 | - [Configuration File](#configuration-file) 35 | - [Notarization-Only Configuration](#notarization-only-configuration) 36 | - [Processing Time](#processing-time) 37 | - [Using within Automation](#using-within-automation) 38 | - [Machine-Readable Output](#machine-readable-output) 39 | - [Prompts](#prompts) 40 | - [Usage with GoReleaser](#usage-with-goreleaser) 41 | - [Go Library](#go-library) 42 | - [Troubleshooting](#troubleshooting) 43 | - [Roadmap](#roadmap) 44 | 45 | 46 | 47 | 48 | ## Features 49 | 50 | * Code sign one or multiple files written in any language 51 | * Package signed files into a dmg or zip 52 | * Notarize packages and wait for the notarization to complete 53 | * Concurrent notarization for multiple output formats 54 | * Stapling notarization tickets to supported formats (dmg) so that 55 | Gatekeeper validation works offline. 56 | 57 | See [roadmap](#roadmap) for features that we want to support but don't yet. 58 | 59 | ## Example 60 | 61 | The example below runs `gon` against itself to generate a zip and dmg. 62 | 63 | ![gon Example](https://user-images.githubusercontent.com/1299/68089803-66961b00-fe21-11e9-820e-cfd7ecae93a2.gif) 64 | 65 | ## Installation 66 | 67 | The easiest way to install `gon` is via [Homebrew](https://brew.sh): 68 | 69 | $ brew install mitchellh/gon/gon 70 | 71 | You may also download the appropriate release for your platform 72 | from the [releases page](https://github.com/mitchellh/gon/releases). 73 | These are all signed and notarized to run out of the box on macOS 10.15+. 74 | 75 | You can also compile from source using Go 1.13 or later using standard 76 | `go build`. Please ensure that Go modules are enabled. 77 | 78 | ## Usage 79 | 80 | `gon` requires a configuration file that can be specified as a file path 81 | or passed in via stdin. The configuration specifies 82 | all the settings `gon` will use to sign and package your files. 83 | 84 | **gon must be run on a macOS machine with XCode 11.0 or later.** Code 85 | signing, notarization, and packaging all require tools that are only available 86 | on macOS machines. 87 | 88 | ``` 89 | $ gon [flags] [CONFIG] 90 | ``` 91 | 92 | When executed, `gon` will sign, package, and notarize configured files 93 | into requested formats. `gon` will exit with a `0` exit code on success 94 | and any other value on failure. 95 | 96 | ### Prerequisite: Acquiring a Developer ID Certificate 97 | 98 | Before using `gon`, you must acquire a Developer ID Certificate. To do 99 | this, you can either do it via the web or via Xcode locally on a Mac. Using 100 | Xcode is easier if you already have it installed. 101 | 102 | Via the web: 103 | 104 | 1. Sign into [developer.apple.com](https://developer.apple.com) with valid 105 | Apple ID credentials. You may need to sign up for an Apple developer account. 106 | 107 | 2. Navigate to the [certificates](https://developer.apple.com/account/resources/certificates/list) 108 | page. 109 | 110 | 3. Click the "+" icon, select "Developer ID Application" and follow the steps. 111 | 112 | 4. After downloading the certificate, double-click to import it into your 113 | keychain. If you're building on a CI machine, every CI machine must have 114 | this certificate in their keychain. 115 | 116 | Via Xcode: 117 | 118 | 1. Open Xcode and go to Xcode => Preferences => Accounts 119 | 120 | 2. Click the "+" in the bottom left and add your Apple ID if you haven't already. 121 | 122 | 3. Select your Apple account and click "Manage Certificates" in the bottom 123 | right corner. 124 | 125 | 4. Click "+" in the bottom left corner and click "Developer ID Application". 126 | 127 | 5. Right-click the newly created cert in the list, click "export" and 128 | export the file as a p12-formatted certificate. _Save this somewhere_. 129 | You'll never be able to download it again. 130 | 131 | To verify you did this correctly, you can inspect your keychain: 132 | 133 | ```sh 134 | $ security find-identity -v 135 | 1) 97E4A93EAA8BAC7A8FD2383BFA459D2898100E56 "Developer ID Application: Mitchell Hashimoto (GK79KXBF4F)" 136 | 1 valid identities found 137 | ``` 138 | 139 | You should see one or more certificates and at least one should be your 140 | Developer ID Application certificate. The hexadecimal string prefix is the 141 | value you can use in your configuration file to specify the identity. 142 | 143 | ### Configuration File 144 | 145 | The configuration file can specify allow/deny lists of licenses for reports, 146 | license overrides for specific dependencies, and more. The configuration file 147 | format is [HCL](https://github.com/hashicorp/hcl/tree/hcl2) or JSON. 148 | 149 | Example: 150 | 151 | ```hcl 152 | source = ["./terraform"] 153 | bundle_id = "com.mitchellh.example.terraform" 154 | 155 | apple_id { 156 | username = "mitchell@example.com" 157 | password = "@env:AC_PASSWORD" 158 | provider = "UL304B4VGY" 159 | } 160 | 161 | sign { 162 | application_identity = "Developer ID Application: Mitchell Hashimoto" 163 | } 164 | 165 | dmg { 166 | output_path = "terraform.dmg" 167 | volume_name = "Terraform" 168 | } 169 | 170 | zip { 171 | output_path = "terraform.zip" 172 | } 173 | ``` 174 | 175 | ```json 176 | { 177 | "source" : ["./terraform"], 178 | "bundle_id" : "com.mitchellh.example.terraform", 179 | "apple_id": { 180 | "username" : "mitchell@example.com", 181 | "password": "@env:AC_PASSWORD", 182 | "provider": "UL304B4VGY" 183 | }, 184 | "sign" :{ 185 | "application_identity" : "Developer ID Application: Mitchell Hashimoto" 186 | }, 187 | "dmg" :{ 188 | "output_path": "terraform.dmg", 189 | "volume_name": "Terraform" 190 | }, 191 | "zip" :{ 192 | "output_path" : "terraform.zip" 193 | } 194 | } 195 | ``` 196 | 197 | Supported configurations: 198 | 199 | * `source` (`array`) - A list of files to sign, package, and 200 | notarize. If you want to sign multiple files with different identities 201 | or into different packages, then you should invoke `gon` with separate 202 | configurations. This is optional if you're using the notarization-only 203 | mode with the `notarize` block. 204 | 205 | * `bundle_id` (`string`) - The [bundle ID](https://cocoacasts.com/what-are-app-ids-and-bundle-identifiers/) 206 | for your application. You should choose something unique for your application. 207 | You can also [register these with Apple](https://developer.apple.com/account/resources/identifiers/list). 208 | This is optional if you're using the notarization-only 209 | mode with the `notarize` block. 210 | 211 | * `apple_id` - Settings related to the Apple ID to use for notarization. 212 | 213 | * `username` (`string`) - The Apple ID username, typically an email address. 214 | This will default to the `AC_USERNAME` environment variable if not set. 215 | 216 | * `password` (`string`) - The password for the associated Apple ID. This can be 217 | specified directly or using `@keychain:` or `@env:` to avoid 218 | putting the plaintext password directly in a configuration file. The `@keychain:` 219 | syntax will load the password from the macOS Keychain with the given name. 220 | The `@env:` syntax will load the password from the named environmental 221 | variable. If this value isn't set, we'll attempt to use the `AC_PASSWORD` 222 | environment variable as a default. 223 | 224 | **NOTE**: If you have 2FA enabled, the password must be an application password, not 225 | your normal apple id password. See [Troubleshooting](#troubleshooting) for details. 226 | 227 | * `provider` (`string`) - The App Store Connect provider when using 228 | multiple teams within App Store Connect. If this isn't set, we'll attempt 229 | to read the `AC_PROVIDER` environment variable as a default. 230 | 231 | * `sign` - Settings related to signing files. 232 | 233 | * `application_identity` (`string`) - The name or ID of the "Developer ID Application" 234 | certificate to use to sign applications. This accepts any valid value for the `-s` 235 | flag for the `codesign` binary on macOS. See `man codesign` for detailed 236 | documentation on accepted values. 237 | 238 | * `entitlements_file` (`string` _optional_) - The full path to a plist format .entitlements file, used for the `--entitlements` argument to `codesign` 239 | 240 | * `dmg` (_optional_) - Settings related to creating a disk image (dmg) as output. 241 | This will only be created if this is specified. The dmg will also have the 242 | notarization ticket stapled so that it can be verified offline and 243 | _do not_ require internet to use. 244 | 245 | * `output_path` (`string`) - The path to create the zip archive. If this path 246 | already exists, it will be overwritten. All files in `source` will be copied 247 | into the root of the zip archive. 248 | 249 | * `volume_name` (`string`) - The name of the mounted dmg that shows up 250 | in finder, the mounted file path, etc. 251 | 252 | * `zip` (_optional_) - Settings related to creating a zip archive as output. A zip archive 253 | will only be created if this is specified. Note that zip archives don't support 254 | stapling, meaning that files within the notarized zip archive will require an 255 | internet connection to verify on first use. 256 | 257 | * `output_path` (`string`) - The path to create the zip archive. If this path 258 | already exists, it will be overwritten. All files in `source` will be copied 259 | into the root of the zip archive. 260 | 261 | Notarization-only mode: 262 | 263 | * `notarize` (_optional_) - Settings for notarizing already built files. 264 | This is an alternative to using the `source` option. This option can be 265 | repeated to notarize multiple files. 266 | 267 | * `path` (`string`) - The path to the file to notarize. This must be 268 | one of Apple's supported file types for notarization: dmg, pkg, app, or 269 | zip. 270 | 271 | * `bundle_id` (`string`) - The bundle ID to use for this notarization. 272 | This is used instead of the top-level `bundle_id` (which controls the 273 | value for source-based runs). 274 | 275 | * `staple` (`bool` _optional_) - Controls if `stapler staple` should run 276 | if notarization succeeds. This should only be set for filetypes that 277 | support it (dmg, pkg, or app). 278 | 279 | 280 | ### Notarization-Only Configuration 281 | 282 | You can configure `gon` to notarize already-signed files. This is useful 283 | if you're integrating `gon` into an existing build pipeline that may already 284 | support creation of pkg, app, etc. files. 285 | 286 | Because notarization requires the payload of packages to also be signed, this 287 | mode assumes that you have codesigned the payload as well as the package 288 | itself. `gon` _will not_ sign your package in the `notarize` blocks. 289 | Please do not confuse this with when `source` is set and `gon` itself 290 | _creates_ your packages, in which case it will also sign them. 291 | 292 | You can use this in addition to specifying `source` as well. In this case, 293 | we will codesign & package the files specified in `source` and then notarize 294 | those results as well as those in `notarize` blocks. 295 | 296 | Example in HCL and then the identical configuration in JSON: 297 | 298 | ```hcl 299 | notarize { 300 | path = "/path/to/terraform.pkg" 301 | bundle_id = "com.mitchellh.example.terraform" 302 | staple = true 303 | } 304 | 305 | apple_id { 306 | username = "mitchell@example.com" 307 | password = "@env:AC_PASSWORD" 308 | } 309 | ``` 310 | 311 | ```json 312 | { 313 | "notarize": [{ 314 | "path": "/path/to/terraform.pkg", 315 | "bundle_id": "com.mitchellh.example.terraform", 316 | "staple": true 317 | }], 318 | 319 | "apple_id": { 320 | "username": "mitchell@example.com", 321 | "password": "@env:AC_PASSWORD" 322 | } 323 | } 324 | ``` 325 | 326 | Note you may specify multiple `notarize` blocks to notarize multipel files 327 | concurrently. 328 | 329 | ### Processing Time 330 | 331 | The notarization process requires submitting your package(s) to Apple 332 | and waiting for them to scan them. Apple provides no public SLA as far as I 333 | can tell. 334 | 335 | In developing `gon` and working with the notarization process, I've 336 | found the process to be fast on average (< 10 minutes) but in some cases 337 | notarization requests have been queued for an hour or more. 338 | 339 | `gon` will output status updates as it goes, and will wait indefinitely 340 | for notarization to complete. If `gon` is interrupted, you can check the 341 | status of a request yourself using the request UUID that `gon` outputs 342 | after submission. 343 | 344 | ### Using within Automation 345 | 346 | `gon` is built to support running within automated environments such 347 | as CI pipelines. In this environment, you should use JSON configuration 348 | files with `gon` and the `-log-json` flag to get structured logging 349 | output. 350 | 351 | #### Machine-Readable Output 352 | 353 | `gon` always outputs human-readable output on stdout (including errors) 354 | and all log output on stderr. By specifying `-log-json` the log entries 355 | will be structured with JSON. You can process the stream of JSON using 356 | a tool such as `jq` or any scripting language to extract critical information 357 | such as the request UUID, status, and more. 358 | 359 | When `gon` is run in an environment with no TTY, the human output will 360 | not be colored. This makes it friendlier for output logs. 361 | 362 | Example: 363 | 364 | $ gon -log-level=info -log-json ./config.hcl 365 | ... 366 | 367 | **Note you must specify _both_ `-log-level` and `-log-json`.** The 368 | `-log-level` flag enables logging in general. An `info` level is enough 369 | in automation environments to get all the information you'd want. 370 | 371 | #### Prompts 372 | 373 | On first-run may be prompted multiple times for passwords. If you 374 | click "Always Allow" then you will not be prompted again. These prompts 375 | are originating from Apple software that `gon` is subprocessing, and not 376 | from `gon` itself. 377 | 378 | I do not currently know how to script the approvals, so the recommendation 379 | on build machines is to run `gon` manually once. If anyone finds a way to 380 | automate this please open an issue, let me know, and I'll update this README. 381 | 382 | ## Usage with GoReleaser 383 | 384 | [GoReleaser](https://goreleaser.com) is a popular full featured release 385 | automation tool for Go-based projects. Gon can be used with GoReleaser to 386 | augment the signing step to notarize your binaries as part of a GoReleaser 387 | pipeline. 388 | 389 | Here is an example GoReleaser configuration to sign your binaries: 390 | 391 | ```yaml 392 | builds: 393 | - binary: foo 394 | id: foo 395 | goos: 396 | - linux 397 | - windows 398 | goarch: 399 | - amd64 400 | # notice that we need a separated build for the macos binary only: 401 | - binary: foo 402 | id: foo-macos 403 | goos: 404 | - darwin 405 | goarch: 406 | - amd64 407 | signs: 408 | - signature: "${artifact}.dmg" 409 | ids: 410 | - foo-macos # here we filter the macos only build id 411 | # you'll need to have gon on PATH 412 | cmd: gon 413 | # you can follow the gon docs to properly create the gon.hcl config file: 414 | # https://github.com/mitchellh/gon 415 | args: 416 | - gon.hcl 417 | artifacts: all 418 | ``` 419 | 420 | To learn more, see the [GoReleaser documentation](https://goreleaser.com/customization/#Signing). 421 | 422 | ## Go Library 423 | 424 | [![Godoc](https://godoc.org/github.com/mitchellh/gon?status.svg)](https://godoc.org/github.com/mitchellh/gon) 425 | 426 | We also expose a supported API for signing, packaging, and notarizing 427 | files using the Go programming language. Please see the linked Go documentation 428 | for more details. 429 | 430 | The libraries exposed are purposely lower level and separate out the sign, 431 | package, notarization, and stapling steps. This lets you integrate this 432 | functionality into any tooling easily vs. having an opinionated `gon`-CLI 433 | experience. 434 | 435 | ## Troubleshooting 436 | 437 | ### "We are unable to create an authentication session. (-22016)" 438 | 439 | You likely have Apple 2FA enabled. You'll need to [generate an application password](https://appleid.apple.com/account/manage) and use that instead of your Apple ID password. 440 | 441 | ## Roadmap 442 | 443 | These are some things I'd love to see but aren't currently implemented. 444 | 445 | * Expose more DMG customization so you can set backgrounds, icons, etc. 446 | - The underlying script we use already supports this. 447 | * Support adding additional files to the zip, dmg packages 448 | * Support the creation of '.app' bundles for CLI applications 449 | -------------------------------------------------------------------------------- /cmd/gon/item.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "context" 5 | "os" 6 | "sync" 7 | 8 | "github.com/fatih/color" 9 | "github.com/hashicorp/go-hclog" 10 | 11 | "github.com/mitchellh/gon/internal/config" 12 | "github.com/mitchellh/gon/notarize" 13 | "github.com/mitchellh/gon/staple" 14 | ) 15 | 16 | // item represents an item to notarize. 17 | type item struct { 18 | // Path is the path to the file to notarize. 19 | Path string 20 | 21 | // BundleId is the bundle ID to use for this notarization. 22 | BundleId string 23 | 24 | // Staple is true if we should perform stapling on this file. Not 25 | // all files support stapling so the default depends on the type of file. 26 | Staple bool 27 | 28 | // state is the current state of this item. 29 | State itemState 30 | } 31 | 32 | // itemState is the state of an item. 33 | type itemState struct { 34 | Notarized bool 35 | NotarizeError error 36 | 37 | Stapled bool 38 | StapleError error 39 | } 40 | 41 | // processOptions are the shared options for running operations on an item. 42 | type processOptions struct { 43 | Config *config.Config 44 | Logger hclog.Logger 45 | 46 | // Prefix is the prefix string for output 47 | Prefix string 48 | 49 | // OutputLock protects access to the terminal output. 50 | // 51 | // UploadLock protects simultaneous notary submission. 52 | OutputLock *sync.Mutex 53 | UploadLock *sync.Mutex 54 | } 55 | 56 | // notarize notarize & staples the item. 57 | func (i *item) notarize(ctx context.Context, opts *processOptions) error { 58 | lock := opts.OutputLock 59 | 60 | // The bundle ID defaults to the root one 61 | bundleId := i.BundleId 62 | if bundleId == "" { 63 | bundleId = opts.Config.BundleId 64 | } 65 | 66 | // Start notarization 67 | _, _, err := notarize.Notarize(ctx, ¬arize.Options{ 68 | File: i.Path, 69 | DeveloperId: opts.Config.AppleId.Username, 70 | Password: opts.Config.AppleId.Password, 71 | Provider: opts.Config.AppleId.Provider, 72 | Logger: opts.Logger.Named("notarize"), 73 | Status: &statusHuman{Prefix: opts.Prefix, Lock: lock}, 74 | UploadLock: opts.UploadLock, 75 | }) 76 | 77 | // Save the error state. We don't save the notarization result yet 78 | // because we don't know it for sure until we retrieve the log information. 79 | i.State.NotarizeError = err 80 | 81 | // If we had an error, we mention immediate we have an error. 82 | if err != nil { 83 | lock.Lock() 84 | color.New(color.FgRed).Fprintf(os.Stdout, " %sError notarizing\n", opts.Prefix) 85 | lock.Unlock() 86 | } 87 | 88 | // If we aren't notarized, then return 89 | if err := i.State.NotarizeError; err != nil { 90 | return err 91 | } 92 | 93 | // Save our state 94 | i.State.Notarized = true 95 | lock.Lock() 96 | color.New(color.FgGreen).Fprintf(os.Stdout, " %sFile notarized!\n", opts.Prefix) 97 | lock.Unlock() 98 | 99 | // If we aren't stapling we exit now 100 | if !i.Staple { 101 | return nil 102 | } 103 | 104 | // Perform the stapling 105 | lock.Lock() 106 | color.New(color.Bold).Fprintf(os.Stdout, " %sStapling...\n", opts.Prefix) 107 | lock.Unlock() 108 | err = staple.Staple(ctx, &staple.Options{ 109 | File: i.Path, 110 | Logger: opts.Logger.Named("staple"), 111 | }) 112 | 113 | // Save our state 114 | i.State.Stapled = err == nil 115 | i.State.StapleError = err 116 | 117 | // After we're done we want to output information for this 118 | // file right away. 119 | lock.Lock() 120 | if err != nil { 121 | color.New(color.FgRed).Fprintf(os.Stdout, " %sNotarization succeeded but stapling failed\n", opts.Prefix) 122 | lock.Unlock() 123 | return err 124 | } 125 | color.New(color.FgGreen).Fprintf(os.Stdout, " %sFile notarized and stapled!\n", opts.Prefix) 126 | lock.Unlock() 127 | 128 | return nil 129 | } 130 | 131 | // String implements Stringer 132 | func (i *item) String() string { 133 | result := i.Path 134 | switch { 135 | case i.State.Notarized && i.State.Stapled: 136 | result += " (notarized and stapled)" 137 | 138 | case i.State.Notarized: 139 | result += " (notarized)" 140 | } 141 | 142 | return result 143 | } 144 | -------------------------------------------------------------------------------- /cmd/gon/main.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "context" 5 | "flag" 6 | "fmt" 7 | "io/ioutil" 8 | "os" 9 | "strings" 10 | "sync" 11 | 12 | "github.com/fatih/color" 13 | "github.com/hashicorp/go-hclog" 14 | "github.com/hashicorp/go-multierror" 15 | 16 | "github.com/mitchellh/gon/internal/config" 17 | "github.com/mitchellh/gon/package/dmg" 18 | "github.com/mitchellh/gon/package/zip" 19 | "github.com/mitchellh/gon/sign" 20 | ) 21 | 22 | // Set by build process 23 | var ( 24 | version string 25 | ) 26 | 27 | func main() { 28 | os.Exit(realMain()) 29 | } 30 | 31 | func realMain() int { 32 | // Look for version 33 | for _, v := range os.Args[1:] { 34 | v = strings.TrimLeft(v, "-") 35 | if v == "v" || v == "version" { 36 | if version == "" { 37 | version = "dev" 38 | } 39 | 40 | fmt.Printf("version %s\n", version) 41 | return 0 42 | } 43 | } 44 | 45 | var logLevel string 46 | var logJSON bool 47 | flags := flag.NewFlagSet(os.Args[0], flag.ExitOnError) 48 | flags.BoolVar(&logJSON, "log-json", false, "Output logs in JSON format for machine readability.") 49 | flags.StringVar(&logLevel, "log-level", "", "Log level to output. Defaults to no logging.") 50 | flags.Parse(os.Args[1:]) 51 | args := flags.Args() 52 | 53 | // Build a logger 54 | logOut := ioutil.Discard 55 | if logLevel != "" { 56 | logOut = os.Stderr 57 | } 58 | logger := hclog.New(&hclog.LoggerOptions{ 59 | Level: hclog.LevelFromString(logLevel), 60 | Output: logOut, 61 | JSONFormat: logJSON, 62 | }) 63 | 64 | // We expect a configuration file 65 | if len(args) != 1 { 66 | fmt.Fprintf(os.Stdout, color.RedString("❗️ Path to configuration expected.\n\n")) 67 | printHelp(flags) 68 | return 1 69 | } 70 | 71 | // Parse the configuration 72 | cfg, err := config.ParseFile(args[0]) 73 | if err != nil { 74 | fmt.Fprintf(os.Stdout, color.RedString("❗️ Error loading configuration:\n\n%s\n", err)) 75 | return 1 76 | } 77 | 78 | // The files to notarize should be added to this. We'll submit one notarization 79 | // request per file here. 80 | var items []*item 81 | 82 | // A bunch of validation 83 | if len(cfg.Source) > 0 { 84 | if cfg.BundleId == "" { 85 | color.New(color.Bold, color.FgRed).Fprintf(os.Stdout, 86 | "❗️ `bundle_id` configuration required with `source` set\n") 87 | color.New(color.FgRed).Fprintf(os.Stdout, 88 | "When you set the `source` configuration, you must also specify the\n"+ 89 | "`bundle_id` that will be used for packaging and notarization.\n") 90 | return 1 91 | } 92 | 93 | if cfg.Sign == nil { 94 | color.New(color.Bold, color.FgRed).Fprintf(os.Stdout, 95 | "❗️ `sign` configuration required with `source` set\n") 96 | color.New(color.FgRed).Fprintf(os.Stdout, 97 | "When you set the `source` configuration, you must also specify the\n"+ 98 | "`sign` configuration to sign the input files.\n") 99 | return 1 100 | } 101 | } else { 102 | if len(cfg.Notarize) == 0 { 103 | color.New(color.Bold, color.FgRed).Fprintf(os.Stdout, "❗️ No source files specified\n") 104 | color.New(color.FgRed).Fprintf(os.Stdout, 105 | "Your configuration had an empty 'source' and empty 'notarize' values. This must be populated with\n"+ 106 | "at least one file to sign, package, and notarize.\n") 107 | return 1 108 | } 109 | 110 | if cfg.Zip != nil { 111 | color.New(color.Bold, color.FgRed).Fprintf(os.Stdout, 112 | "❗️ `zip` can only be set while `source` is also set\n") 113 | color.New(color.FgRed).Fprintf(os.Stdout, 114 | "Zip packaging is only supported when `source` is specified. This is\n"+ 115 | "because the `zip` option packages the source files. If there are no\n"+ 116 | "source files specified, then there is nothing to package.\n") 117 | return 1 118 | } 119 | 120 | if cfg.Dmg != nil { 121 | color.New(color.Bold, color.FgRed).Fprintf(os.Stdout, 122 | "❗️ `dmg` can only be set while `source` is also set\n") 123 | color.New(color.FgRed).Fprintf(os.Stdout, 124 | "Dmg packaging is only supported when `source` is specified. This is\n"+ 125 | "because the `dmg` option packages the source files. If there are no\n"+ 126 | "source files specified, then there is nothing to package.\n") 127 | return 1 128 | } 129 | } 130 | 131 | // Notarize is an alternative to "Source", where you specify 132 | // a single .pkg or .zip that is ready for notarization and stapling 133 | if len(cfg.Notarize) > 0 { 134 | for _, c := range cfg.Notarize { 135 | items = append(items, &item{ 136 | Path: c.Path, 137 | BundleId: c.BundleId, 138 | Staple: c.Staple, 139 | }) 140 | } 141 | } 142 | 143 | // If not specified in the configuration, we initialize a new struct that we'll 144 | // load with values from the environment. 145 | if cfg.AppleId == nil { 146 | cfg.AppleId = &config.AppleId{} 147 | } 148 | if cfg.AppleId.Username == "" { 149 | appleIdUsername, ok := os.LookupEnv("AC_USERNAME") 150 | if !ok { 151 | color.New(color.Bold, color.FgRed).Fprintf(os.Stdout, "❗️ No apple_id username provided\n") 152 | color.New(color.FgRed).Fprintf(os.Stdout, 153 | "An Apple ID username must be specified in the `apple_id` block or\n"+ 154 | "it must exist in the environment as AC_USERNAME,\n"+ 155 | "otherwise we won't be able to authenticate with Apple to notarize.\n") 156 | return 1 157 | } 158 | 159 | cfg.AppleId.Username = appleIdUsername 160 | } 161 | 162 | if cfg.AppleId.Password == "" { 163 | if _, ok := os.LookupEnv("AC_PASSWORD"); !ok { 164 | color.New(color.Bold, color.FgRed).Fprintf(os.Stdout, "❗️ No apple_id password provided\n") 165 | color.New(color.FgRed).Fprintf(os.Stdout, 166 | "An Apple ID password (or lookup directive) must be specified in the\n"+ 167 | "`apple_id` block or it must exist in the environment as AC_PASSWORD,\n"+ 168 | "otherwise we won't be able to authenticate with Apple to notarize.\n") 169 | return 1 170 | } 171 | 172 | cfg.AppleId.Password = "@env:AC_PASSWORD" 173 | } 174 | if cfg.AppleId.Provider == "" { 175 | cfg.AppleId.Provider = os.Getenv("AC_PROVIDER") 176 | } 177 | 178 | // If we're in source mode, then sign & package as configured 179 | if len(cfg.Source) > 0 { 180 | if cfg.Sign != nil { 181 | // Perform codesigning 182 | color.New(color.Bold).Fprintf(os.Stdout, "==> %s Signing files...\n", iconSign) 183 | err = sign.Sign(context.Background(), &sign.Options{ 184 | Files: cfg.Source, 185 | Identity: cfg.Sign.ApplicationIdentity, 186 | Entitlements: cfg.Sign.EntitlementsFile, 187 | Logger: logger.Named("sign"), 188 | }) 189 | if err != nil { 190 | fmt.Fprintf(os.Stdout, color.RedString("❗️ Error signing files:\n\n%s\n", err)) 191 | return 1 192 | } 193 | color.New(color.Bold, color.FgGreen).Fprintf(os.Stdout, " Code signing successful\n") 194 | } 195 | 196 | // Create a zip 197 | if cfg.Zip != nil { 198 | color.New(color.Bold).Fprintf(os.Stdout, "==> %s Creating Zip archive...\n", iconPackage) 199 | err = zip.Zip(context.Background(), &zip.Options{ 200 | Files: cfg.Source, 201 | OutputPath: cfg.Zip.OutputPath, 202 | }) 203 | if err != nil { 204 | fmt.Fprintf(os.Stdout, color.RedString("❗️ Error creating zip archive:\n\n%s\n", err)) 205 | return 1 206 | } 207 | color.New(color.Bold, color.FgGreen).Fprintf(os.Stdout, " Zip archive created with signed files\n") 208 | 209 | // Queue to notarize 210 | items = append(items, &item{Path: cfg.Zip.OutputPath}) 211 | } 212 | 213 | // Create a dmg 214 | if cfg.Dmg != nil && cfg.Sign != nil { 215 | // First create the dmg itself. This passes in the signed files. 216 | color.New(color.Bold).Fprintf(os.Stdout, "==> %s Creating dmg...\n", iconPackage) 217 | color.New().Fprintf(os.Stdout, " This will open Finder windows momentarily.\n") 218 | err = dmg.Dmg(context.Background(), &dmg.Options{ 219 | Files: cfg.Source, 220 | OutputPath: cfg.Dmg.OutputPath, 221 | VolumeName: cfg.Dmg.VolumeName, 222 | Logger: logger.Named("dmg"), 223 | }) 224 | if err != nil { 225 | fmt.Fprintf(os.Stdout, color.RedString("❗️ Error creating dmg:\n\n%s\n", err)) 226 | return 1 227 | } 228 | color.New().Fprintf(os.Stdout, " Dmg file created: %s\n", cfg.Dmg.OutputPath) 229 | 230 | // Next we need to sign the actual DMG as well 231 | color.New().Fprintf(os.Stdout, " Signing dmg...\n") 232 | err = sign.Sign(context.Background(), &sign.Options{ 233 | Files: []string{cfg.Dmg.OutputPath}, 234 | Identity: cfg.Sign.ApplicationIdentity, 235 | Logger: logger.Named("dmg"), 236 | }) 237 | if err != nil { 238 | fmt.Fprintf(os.Stdout, color.RedString("❗️ Error signing dmg:\n\n%s\n", err)) 239 | return 1 240 | } 241 | color.New(color.Bold, color.FgGreen).Fprintf(os.Stdout, " Dmg created and signed\n") 242 | 243 | // Queue to notarize 244 | items = append(items, &item{Path: cfg.Dmg.OutputPath, Staple: true}) 245 | } 246 | } 247 | 248 | // If we have no items to notarize then its probably an error in the configuration. 249 | if len(items) == 0 { 250 | color.New(color.Bold, color.FgYellow).Fprintf(os.Stdout, "\n⚠️ No items to notarize\n") 251 | color.New(color.FgYellow).Fprintf(os.Stdout, 252 | "You must specify a 'notarize' section or a 'source' section plus a 'zip' or 'dmg' section "+ 253 | "in your configuration to enable packaging and notarization. Without these sections, gon\n"+ 254 | "will only sign your input files in 'source'.\n") 255 | return 0 256 | } 257 | 258 | // Notarize 259 | color.New(color.Bold).Fprintf(os.Stdout, "==> %s Notarizing...\n", iconNotarize) 260 | if len(items) > 1 { 261 | color.New().Fprintf(os.Stdout, " Files will be notarized concurrently to optimize queue wait\n") 262 | } 263 | for _, f := range items { 264 | color.New().Fprintf(os.Stdout, " Path: %s\n", f.Path) 265 | } 266 | 267 | // Build our prefixes 268 | prefixes := statusPrefixList(items) 269 | 270 | // Start our notarizations 271 | var wg sync.WaitGroup 272 | var lock, uploadLock sync.Mutex 273 | var totalErr error 274 | for idx := range items { 275 | wg.Add(1) 276 | go func(idx int) { 277 | defer wg.Done() 278 | 279 | err := items[idx].notarize(context.Background(), &processOptions{ 280 | Config: cfg, 281 | Logger: logger, 282 | Prefix: prefixes[idx], 283 | OutputLock: &lock, 284 | UploadLock: &uploadLock, 285 | }) 286 | 287 | if err != nil { 288 | lock.Lock() 289 | defer lock.Unlock() 290 | totalErr = multierror.Append(totalErr, err) 291 | } 292 | }(idx) 293 | } 294 | 295 | // Wait for notarization to happen 296 | wg.Wait() 297 | 298 | // If totalErr is not nil then we had one or more errors. 299 | if totalErr != nil { 300 | fmt.Fprintf(os.Stdout, color.RedString("\n❗️ Error notarizing:\n\n%s\n", totalErr)) 301 | return 1 302 | } 303 | 304 | // Success, output all the files that were notarized again to remind the user 305 | color.New(color.Bold, color.FgGreen).Fprintf(os.Stdout, "\nNotarization complete! Notarized files:\n") 306 | for _, f := range items { 307 | color.New(color.FgGreen).Fprintf(os.Stdout, " - %s\n", f.String()) 308 | } 309 | 310 | return 0 311 | } 312 | 313 | func printHelp(fs *flag.FlagSet) { 314 | fmt.Fprintf(os.Stdout, strings.TrimSpace(help)+"\n\n", os.Args[0]) 315 | fs.PrintDefaults() 316 | } 317 | 318 | const help = ` 319 | gon signs, notarizes, and packages binaries for macOS. 320 | 321 | Usage: %[1]s [flags] CONFIG 322 | 323 | A configuration file is required to use gon. If a "-" is specified, gon 324 | will attempt to read the configuration from stdin. Configuration is in HCL 325 | or JSON format. The JSON format makes it particularly easy to machine-generate 326 | the configuration and pass it into gon. 327 | 328 | For example configurations as well as full help text, see the README on GitHub: 329 | http://github.com/mitchellh/gon 330 | 331 | Flags: 332 | ` 333 | 334 | const iconSign = `✏️` 335 | const iconPackage = `📦` 336 | const iconNotarize = `🍎` 337 | -------------------------------------------------------------------------------- /cmd/gon/status_human.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "fmt" 5 | "os" 6 | "path/filepath" 7 | "strings" 8 | "sync" 9 | 10 | "github.com/fatih/color" 11 | 12 | "github.com/mitchellh/gon/notarize" 13 | ) 14 | 15 | // statusHuman implements notarize.Status and outputs information to 16 | // the CLI for human consumption. 17 | type statusHuman struct { 18 | Prefix string 19 | Lock *sync.Mutex 20 | 21 | lastInfoStatus string 22 | lastLogStatus string 23 | } 24 | 25 | func (s *statusHuman) Submitting() { 26 | s.Lock.Lock() 27 | defer s.Lock.Unlock() 28 | 29 | color.New().Fprintf(os.Stdout, " %sSubmitting file for notarization...\n", s.Prefix) 30 | } 31 | 32 | func (s *statusHuman) Submitted(uuid string) { 33 | s.Lock.Lock() 34 | defer s.Lock.Unlock() 35 | 36 | color.New().Fprintf(os.Stdout, " %sSubmitted. Request UUID: %s\n", s.Prefix, uuid) 37 | color.New().Fprintf( 38 | os.Stdout, " %sWaiting for results from Apple. This can take minutes to hours.\n", s.Prefix) 39 | } 40 | 41 | func (s *statusHuman) InfoStatus(info notarize.Info) { 42 | s.Lock.Lock() 43 | defer s.Lock.Unlock() 44 | 45 | if info.Status != s.lastInfoStatus { 46 | s.lastInfoStatus = info.Status 47 | color.New().Fprintf(os.Stdout, " %sInfoStatus: %s\n", s.Prefix, info.Status) 48 | } 49 | } 50 | 51 | func (s *statusHuman) LogStatus(log notarize.Log) { 52 | s.Lock.Lock() 53 | defer s.Lock.Unlock() 54 | 55 | if log.Status != s.lastLogStatus { 56 | s.lastLogStatus = log.Status 57 | color.New().Fprintf(os.Stdout, " %sLogStatus: %s\n", s.Prefix, log.Status) 58 | } 59 | } 60 | 61 | // statusPrefixList takes a list of items and returns the prefixes to use 62 | // with status messages for each. The returned slice is guaranteed to be 63 | // allocated and the same length as items. 64 | func statusPrefixList(items []*item) []string { 65 | // Special-case: for lists of one, we don't use any prefix at all. 66 | if len(items) == 1 { 67 | return []string{""} 68 | } 69 | 70 | // Create a list of basenames and also keep track of max length 71 | result := make([]string, len(items)) 72 | max := 0 73 | for idx, f := range items { 74 | result[idx] = filepath.Base(f.Path) 75 | if l := len(result[idx]); l > max { 76 | max = l 77 | } 78 | } 79 | 80 | // Pad all the strings to the max length 81 | for idx, _ := range result { 82 | result[idx] += strings.Repeat(" ", max-len(result[idx])) 83 | result[idx] = fmt.Sprintf("[%s] ", result[idx]) 84 | } 85 | 86 | return result 87 | } 88 | 89 | var _ notarize.Status = (*statusHuman)(nil) 90 | -------------------------------------------------------------------------------- /go.mod: -------------------------------------------------------------------------------- 1 | module github.com/mitchellh/gon 2 | 3 | go 1.13 4 | 5 | require ( 6 | github.com/davecgh/go-spew v1.1.1 7 | github.com/fatih/color v1.7.0 8 | github.com/hashicorp/go-hclog v0.9.3-0.20191025211905-234833755cb2 9 | github.com/hashicorp/go-multierror v1.0.0 10 | github.com/hashicorp/hcl/v2 v2.0.0 11 | github.com/sebdah/goldie v1.0.0 12 | github.com/stretchr/testify v1.3.0 13 | howett.net/plist v0.0.0-20181124034731-591f970eefbb 14 | ) 15 | -------------------------------------------------------------------------------- /go.sum: -------------------------------------------------------------------------------- 1 | github.com/agext/levenshtein v1.2.1 h1:QmvMAjj2aEICytGiWzmxoE0x2KZvE0fvmqMOfy2tjT8= 2 | github.com/agext/levenshtein v1.2.1/go.mod h1:JEDfjyjHDjOF/1e4FlBE/PkbqA9OfWu2ki2W0IB5558= 3 | github.com/apparentlymart/go-dump v0.0.0-20180507223929-23540a00eaa3/go.mod h1:oL81AME2rN47vu18xqj1S1jPIPuN7afo62yKTNn3XMM= 4 | github.com/apparentlymart/go-textseg v1.0.0 h1:rRmlIsPEEhUTIKQb7T++Nz/A5Q6C9IuX2wFoYVvnCs0= 5 | github.com/apparentlymart/go-textseg v1.0.0/go.mod h1:z96Txxhf3xSFMPmb5X/1W05FF/Nj9VFpLOpjS5yuumk= 6 | github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= 7 | github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= 8 | github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= 9 | github.com/fatih/color v1.7.0 h1:DkWD4oS2D8LGGgTQ6IvwJJXSL5Vp2ffcQg58nFV38Ys= 10 | github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= 11 | github.com/go-test/deep v1.0.3 h1:ZrJSEWsXzPOxaZnFteGEfooLba+ju3FYIbOrS+rQd68= 12 | github.com/go-test/deep v1.0.3/go.mod h1:wGDj63lr65AM2AQyKZd/NYHGb0R+1RLqB8NKt3aSFNA= 13 | github.com/golang/protobuf v1.1.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= 14 | github.com/google/go-cmp v0.2.0 h1:+dTQ8DZQJz0Mb/HjFlkptS1FeQ4cWSnN941F8aEG4SQ= 15 | github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= 16 | github.com/hashicorp/errwrap v1.0.0 h1:hLrqtEDnRye3+sgx6z4qVLNuviH3MR5aQ0ykNJa/UYA= 17 | github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= 18 | github.com/hashicorp/go-hclog v0.9.3-0.20191025211905-234833755cb2 h1:STV8OvzphW1vlhPFxcG8d6OIilzBSKRAoWFJt+Onu10= 19 | github.com/hashicorp/go-hclog v0.9.3-0.20191025211905-234833755cb2/go.mod h1:whpDNt7SSdeAju8AWKIWsul05p54N/39EeqMAyrmvFQ= 20 | github.com/hashicorp/go-multierror v1.0.0 h1:iVjPR7a6H0tWELX5NxNe7bYopibicUzc7uPribsnS6o= 21 | github.com/hashicorp/go-multierror v1.0.0/go.mod h1:dHtQlpGsu+cZNNAkkCN/P3hoUDHhCYQXV3UM06sGGrk= 22 | github.com/hashicorp/hcl/v2 v2.0.0 h1:efQznTz+ydmQXq3BOnRa3AXzvCeTq1P4dKj/z5GLlY8= 23 | github.com/hashicorp/hcl/v2 v2.0.0/go.mod h1:oVVDG71tEinNGYCxinCYadcmKU9bglqW9pV3txagJ90= 24 | github.com/jessevdk/go-flags v1.4.0/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI= 25 | github.com/kr/pretty v0.1.0 h1:L/CwN0zerZDmRFUapSPitk6f+Q3+0za1rQkzVuMiMFI= 26 | github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= 27 | github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= 28 | github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE= 29 | github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= 30 | github.com/kylelemons/godebug v0.0.0-20170820004349-d65d576e9348 h1:MtvEpTB6LX3vkb4ax0b5D2DHbNAUsen0Gx5wZoq3lV4= 31 | github.com/kylelemons/godebug v0.0.0-20170820004349-d65d576e9348/go.mod h1:B69LEHPfb2qLo0BaaOLcbitczOKLWTsrBG9LczfCD4k= 32 | github.com/mattn/go-colorable v0.1.4 h1:snbPLB8fVfU9iwbbo30TPtbLRzwWu6aJS6Xh4eaaviA= 33 | github.com/mattn/go-colorable v0.1.4/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE= 34 | github.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= 35 | github.com/mattn/go-isatty v0.0.10 h1:qxFzApOv4WsAL965uUPIsXzAKCZxN2p9UqdhFS4ZW10= 36 | github.com/mattn/go-isatty v0.0.10/go.mod h1:qgIWMr58cqv1PHHyhnkY9lrL7etaEgOFcMEpPG5Rm84= 37 | github.com/mitchellh/go-wordwrap v0.0.0-20150314170334-ad45545899c7 h1:DpOJ2HYzCv8LZP15IdmG+YdwD2luVPHITV96TkirNBM= 38 | github.com/mitchellh/go-wordwrap v0.0.0-20150314170334-ad45545899c7/go.mod h1:ZXFpozHsX6DPmq2I0TCekCxypsnAUbP2oI0UX1GXzOo= 39 | github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= 40 | github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= 41 | github.com/sebdah/goldie v1.0.0 h1:9GNhIat69MSlz/ndaBg48vl9dF5fI+NBB6kfOxgfkMc= 42 | github.com/sebdah/goldie v1.0.0/go.mod h1:jXP4hmWywNEwZzhMuv2ccnqTSFpuq8iyQhtQdkkZBH4= 43 | github.com/sergi/go-diff v1.0.0 h1:Kpca3qRNrduNnOQeazBd0ysaKrUJiIuISHxogkT9RPQ= 44 | github.com/sergi/go-diff v1.0.0/go.mod h1:0CfEIISq7TuYL3j771MWULgwwjU+GofnZX9QAmXWZgo= 45 | github.com/spf13/pflag v1.0.2/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= 46 | github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= 47 | github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= 48 | github.com/stretchr/testify v1.3.0 h1:TivCn/peBQ7UY8ooIcPgZFpTNSz0Q2U6UrFlUfqbe0Q= 49 | github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= 50 | github.com/vmihailenco/msgpack v3.3.3+incompatible/go.mod h1:fy3FlTQTDXWkZ7Bh6AcGMlsjHatGryHQYUTf1ShIgkk= 51 | github.com/zclconf/go-cty v1.1.0 h1:uJwc9HiBOCpoKIObTQaLR+tsEXx1HBHnOsOOpcdhZgw= 52 | github.com/zclconf/go-cty v1.1.0/go.mod h1:xnAOWiHeOqg2nWS62VtQ7pbOu17FtxJNW8RLEih+O3s= 53 | golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= 54 | golang.org/x/crypto v0.0.0-20190426145343-a29dc8fdc734/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= 55 | golang.org/x/net v0.0.0-20180811021610-c39426892332/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= 56 | golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= 57 | golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= 58 | golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= 59 | golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= 60 | golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 61 | golang.org/x/sys v0.0.0-20190502175342-a43fa875dd82/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 62 | golang.org/x/sys v0.0.0-20191008105621-543471e840be h1:QAcqgptGM8IQBC9K/RC4o+O9YmqEm0diQn9QmZw/0mU= 63 | golang.org/x/sys v0.0.0-20191008105621-543471e840be/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 64 | golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= 65 | golang.org/x/text v0.3.2 h1:tW2bmiBqwgJj/UpqtC8EpXEZVYOwU0yG4iWbprSVAcs= 66 | golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= 67 | golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= 68 | google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= 69 | gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= 70 | gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= 71 | gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= 72 | howett.net/plist v0.0.0-20181124034731-591f970eefbb h1:jhnBjNi9UFpfpl8YZhA9CrOqpnJdvzuiHsl/dnxl11M= 73 | howett.net/plist v0.0.0-20181124034731-591f970eefbb/go.mod h1:vMygbs4qMhSZSc4lCUl2OEE+rDiIIJAIdR4m7MiMcm0= 74 | -------------------------------------------------------------------------------- /internal/config/config.go: -------------------------------------------------------------------------------- 1 | package config 2 | 3 | // Config is the configuration structure for gon. 4 | type Config struct { 5 | // Source is the list of binary files to sign. 6 | Source []string `hcl:"source,optional"` 7 | 8 | // BundleId is the bundle ID to use for the package that is created. 9 | // This should be in a format such as "com.example.app". The value can 10 | // be anything, this is required by Apple. 11 | BundleId string `hcl:"bundle_id,optional"` 12 | 13 | // Notarize is a single file (usually a .pkg installer or zip) 14 | // that is ready for notarization as-is 15 | Notarize []Notarize `hcl:"notarize,block"` 16 | 17 | // Sign are the settings for code-signing the binaries. 18 | Sign *Sign `hcl:"sign,block"` 19 | 20 | // AppleId are the credentials to use to talk to Apple. 21 | AppleId *AppleId `hcl:"apple_id,block"` 22 | 23 | // Zip, if present, creates a notarized zip file as the output. Note 24 | // that zip files do not support stapling, so the final result will 25 | // require an internet connection on first use to validate the notarization. 26 | Zip *Zip `hcl:"zip,block"` 27 | 28 | // Dmg, if present, creates a dmg file to package the signed `Source` files 29 | // into. Dmg files support stapling so this allows offline usage. 30 | Dmg *Dmg `hcl:"dmg,block"` 31 | } 32 | 33 | // AppleId are the authentication settings for Apple systems. 34 | type AppleId struct { 35 | // Username is your AC username, typically an email. This is required, but will 36 | // be read from the environment via AC_USERNAME if not specified via config. 37 | Username string `hcl:"username,optional"` 38 | 39 | // Password is the password for your AC account. This also accepts 40 | // two additional forms: '@keychain:' which reads the password from 41 | // the keychain and '@env:' which reads the password from an 42 | // an environmental variable named . If omitted, it has the same effect 43 | // as passing '@env:AC_PASSWORD'. 44 | Password string `hcl:"password,optional"` 45 | 46 | // Provider is the AC provider. This is optional and only needs to be 47 | // specified if you're using an Apple ID account that has multiple 48 | // teams. 49 | Provider string `hcl:"provider,optional"` 50 | } 51 | 52 | // Notarize are the options for notarizing a pre-built file. 53 | type Notarize struct { 54 | // Path is the path to the file to notarize. This can be any supported 55 | // filetype (dmg, pkg, app, zip). 56 | Path string `hcl:"path"` 57 | 58 | // BundleId is the bundle ID to use for notarizing this package. 59 | // If this isn't specified then the root bundle_id is inherited. 60 | BundleId string `hcl:"bundle_id"` 61 | 62 | // Staple, if true will staple the notarization ticket to the file. 63 | Staple bool `hcl:"staple,optional"` 64 | } 65 | 66 | // Sign are the options for codesigning the binaries. 67 | type Sign struct { 68 | // ApplicationIdentity is the ID or name of the certificate to 69 | // use for signing binaries. This is used for all binaries in "source". 70 | ApplicationIdentity string `hcl:"application_identity"` 71 | // Specify a path to an entitlements file in plist format 72 | EntitlementsFile string `hcl:"entitlements_file,optional"` 73 | } 74 | 75 | // Dmg are the options for a dmg file as output. 76 | type Dmg struct { 77 | // OutputPath is the path where the final dmg will be saved. 78 | OutputPath string `hcl:"output_path"` 79 | 80 | // Volume name is the name of the volume that shows up in the title 81 | // and sidebar after opening it. 82 | VolumeName string `hcl:"volume_name"` 83 | } 84 | 85 | // Zip are the options for a zip file as output. 86 | type Zip struct { 87 | // OutputPath is the path where the final zip file will be saved. 88 | OutputPath string `hcl:"output_path"` 89 | } 90 | -------------------------------------------------------------------------------- /internal/config/parse.go: -------------------------------------------------------------------------------- 1 | package config 2 | 3 | import ( 4 | "io" 5 | "io/ioutil" 6 | 7 | "github.com/hashicorp/hcl/v2/hclsimple" 8 | ) 9 | 10 | // ParseFile parses the given file for a configuration. The syntax of the 11 | // file is determined based on the filename extension: "hcl" for HCL, 12 | // "json" for JSON, other is an error. 13 | func ParseFile(filename string) (*Config, error) { 14 | var config Config 15 | return &config, hclsimple.DecodeFile(filename, nil, &config) 16 | } 17 | 18 | // Parse parses the configuration from the given reader. The reader will be 19 | // read to completion (EOF) before returning so ensure that the reader 20 | // does not block forever. 21 | // 22 | // format is either "hcl" or "json" 23 | func Parse(r io.Reader, filename, format string) (*Config, error) { 24 | src, err := ioutil.ReadAll(r) 25 | if err != nil { 26 | return nil, err 27 | } 28 | 29 | var config Config 30 | return &config, hclsimple.Decode("config.hcl", src, nil, &config) 31 | } 32 | -------------------------------------------------------------------------------- /internal/config/parse_test.go: -------------------------------------------------------------------------------- 1 | package config 2 | 3 | import ( 4 | "os" 5 | "path/filepath" 6 | "testing" 7 | 8 | "github.com/davecgh/go-spew/spew" 9 | "github.com/sebdah/goldie" 10 | "github.com/stretchr/testify/require" 11 | ) 12 | 13 | func init() { 14 | goldie.FixtureDir = "testdata" 15 | spew.Config.DisablePointerAddresses = true 16 | } 17 | 18 | func TestParseFile(t *testing.T) { 19 | f, err := os.Open("testdata") 20 | require.NoError(t, err) 21 | defer f.Close() 22 | 23 | fis, err := f.Readdir(-1) 24 | require.NoError(t, err) 25 | for _, fi := range fis { 26 | if fi.IsDir() { 27 | continue 28 | } 29 | 30 | if filepath.Ext(fi.Name()) == ".golden" { 31 | continue 32 | } 33 | 34 | t.Run(fi.Name(), func(t *testing.T) { 35 | cfg, err := ParseFile(filepath.Join("testdata", fi.Name())) 36 | require.NoError(t, err) 37 | goldie.Assert(t, fi.Name(), []byte(spew.Sdump(cfg))) 38 | }) 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /internal/config/testdata/basic.hcl: -------------------------------------------------------------------------------- 1 | source = ["./terraform"] 2 | bundle_id = "com.mitchellh.test.terraform" 3 | 4 | apple_id { 5 | username = "mitchellh@example.com" 6 | password = "hello" 7 | } 8 | 9 | sign { 10 | application_identity = "foo" 11 | } 12 | -------------------------------------------------------------------------------- /internal/config/testdata/basic.hcl.golden: -------------------------------------------------------------------------------- 1 | (*config.Config)({ 2 | Source: ([]string) (len=1 cap=1) { 3 | (string) (len=11) "./terraform" 4 | }, 5 | BundleId: (string) (len=28) "com.mitchellh.test.terraform", 6 | Notarize: ([]config.Notarize) , 7 | Sign: (*config.Sign)({ 8 | ApplicationIdentity: (string) (len=3) "foo", 9 | EntitlementsFile: (string) "" 10 | }), 11 | AppleId: (*config.AppleId)({ 12 | Username: (string) (len=21) "mitchellh@example.com", 13 | Password: (string) (len=5) "hello", 14 | Provider: (string) "" 15 | }), 16 | Zip: (*config.Zip)(), 17 | Dmg: (*config.Dmg)() 18 | }) 19 | -------------------------------------------------------------------------------- /internal/config/testdata/entitle.hcl: -------------------------------------------------------------------------------- 1 | source = ["./terraform"] 2 | bundle_id = "com.mitchellh.test.terraform" 3 | 4 | apple_id { 5 | username = "mitchellh@example.com" 6 | password = "hello" 7 | } 8 | 9 | sign { 10 | application_identity = "foo" 11 | entitlements_file = "/path/to/example.entitlements" 12 | } 13 | -------------------------------------------------------------------------------- /internal/config/testdata/entitle.hcl.golden: -------------------------------------------------------------------------------- 1 | (*config.Config)({ 2 | Source: ([]string) (len=1 cap=1) { 3 | (string) (len=11) "./terraform" 4 | }, 5 | BundleId: (string) (len=28) "com.mitchellh.test.terraform", 6 | Notarize: ([]config.Notarize) , 7 | Sign: (*config.Sign)({ 8 | ApplicationIdentity: (string) (len=3) "foo", 9 | EntitlementsFile: (string) (len=29) "/path/to/example.entitlements" 10 | }), 11 | AppleId: (*config.AppleId)({ 12 | Username: (string) (len=21) "mitchellh@example.com", 13 | Password: (string) (len=5) "hello", 14 | Provider: (string) "" 15 | }), 16 | Zip: (*config.Zip)(), 17 | Dmg: (*config.Dmg)() 18 | }) 19 | -------------------------------------------------------------------------------- /internal/config/testdata/env_appleid.hcl: -------------------------------------------------------------------------------- 1 | source = ["./terraform"] 2 | bundle_id = "com.mitchellh.test.terraform" 3 | 4 | sign { 5 | application_identity = "foo" 6 | } 7 | -------------------------------------------------------------------------------- /internal/config/testdata/env_appleid.hcl.golden: -------------------------------------------------------------------------------- 1 | (*config.Config)({ 2 | Source: ([]string) (len=1 cap=1) { 3 | (string) (len=11) "./terraform" 4 | }, 5 | BundleId: (string) (len=28) "com.mitchellh.test.terraform", 6 | Notarize: ([]config.Notarize) , 7 | Sign: (*config.Sign)({ 8 | ApplicationIdentity: (string) (len=3) "foo", 9 | EntitlementsFile: (string) "" 10 | }), 11 | AppleId: (*config.AppleId)(), 12 | Zip: (*config.Zip)(), 13 | Dmg: (*config.Dmg)() 14 | }) 15 | -------------------------------------------------------------------------------- /internal/config/testdata/notarize.hcl: -------------------------------------------------------------------------------- 1 | source = [] 2 | bundle_id = "com.example.terraform" 3 | 4 | notarize { 5 | path = "/path/to/terraform.pkg" 6 | bundle_id = "foo.bar" 7 | } 8 | 9 | apple_id { 10 | username = "mitchellh@example.com" 11 | password = "hello" 12 | } 13 | -------------------------------------------------------------------------------- /internal/config/testdata/notarize.hcl.golden: -------------------------------------------------------------------------------- 1 | (*config.Config)({ 2 | Source: ([]string) { 3 | }, 4 | BundleId: (string) (len=21) "com.example.terraform", 5 | Notarize: ([]config.Notarize) (len=1 cap=1) { 6 | (config.Notarize) { 7 | Path: (string) (len=22) "/path/to/terraform.pkg", 8 | BundleId: (string) (len=7) "foo.bar", 9 | Staple: (bool) false 10 | } 11 | }, 12 | Sign: (*config.Sign)(), 13 | AppleId: (*config.AppleId)({ 14 | Username: (string) (len=21) "mitchellh@example.com", 15 | Password: (string) (len=5) "hello", 16 | Provider: (string) "" 17 | }), 18 | Zip: (*config.Zip)(), 19 | Dmg: (*config.Dmg)() 20 | }) 21 | -------------------------------------------------------------------------------- /internal/config/testdata/notarize_multiple.hcl: -------------------------------------------------------------------------------- 1 | source = [] 2 | bundle_id = "" 3 | 4 | notarize { 5 | path = "/path/to/terraform.pkg" 6 | bundle_id = "foo.bar" 7 | } 8 | 9 | notarize { 10 | path = "/path/to/terraform.pkg" 11 | bundle_id = "foo.bar" 12 | staple = true 13 | } 14 | 15 | apple_id { 16 | username = "mitchellh@example.com" 17 | password = "hello" 18 | } 19 | -------------------------------------------------------------------------------- /internal/config/testdata/notarize_multiple.hcl.golden: -------------------------------------------------------------------------------- 1 | (*config.Config)({ 2 | Source: ([]string) { 3 | }, 4 | BundleId: (string) "", 5 | Notarize: ([]config.Notarize) (len=2 cap=2) { 6 | (config.Notarize) { 7 | Path: (string) (len=22) "/path/to/terraform.pkg", 8 | BundleId: (string) (len=7) "foo.bar", 9 | Staple: (bool) false 10 | }, 11 | (config.Notarize) { 12 | Path: (string) (len=22) "/path/to/terraform.pkg", 13 | BundleId: (string) (len=7) "foo.bar", 14 | Staple: (bool) true 15 | } 16 | }, 17 | Sign: (*config.Sign)(), 18 | AppleId: (*config.AppleId)({ 19 | Username: (string) (len=21) "mitchellh@example.com", 20 | Password: (string) (len=5) "hello", 21 | Provider: (string) "" 22 | }), 23 | Zip: (*config.Zip)(), 24 | Dmg: (*config.Dmg)() 25 | }) 26 | -------------------------------------------------------------------------------- /internal/createdmg/bindata/bindata.go: -------------------------------------------------------------------------------- 1 | // Code generated by go-bindata. DO NOT EDIT. 2 | // sources: 3 | // ../../../vendor/create-dmg/LICENSE (1.088kB) 4 | // ../../../vendor/create-dmg/README.md (3.575kB) 5 | // ../../../vendor/create-dmg/builder/create-dmg.builder (516B) 6 | // ../../../vendor/create-dmg/create-dmg (12.452kB) 7 | // ../../../vendor/create-dmg/sample (506B) 8 | // ../../../vendor/create-dmg/support/brew-me.sh (697B) 9 | // ../../../vendor/create-dmg/support/dmg-license.py (6.279kB) 10 | // ../../../vendor/create-dmg/support/template.applescript (1.828kB) 11 | 12 | package bindata 13 | 14 | import ( 15 | "bytes" 16 | "compress/gzip" 17 | "crypto/sha256" 18 | "fmt" 19 | "io" 20 | "io/ioutil" 21 | "os" 22 | "path/filepath" 23 | "strings" 24 | "time" 25 | ) 26 | 27 | func bindataRead(data []byte, name string) ([]byte, error) { 28 | gz, err := gzip.NewReader(bytes.NewBuffer(data)) 29 | if err != nil { 30 | return nil, fmt.Errorf("read %q: %v", name, err) 31 | } 32 | 33 | var buf bytes.Buffer 34 | _, err = io.Copy(&buf, gz) 35 | clErr := gz.Close() 36 | 37 | if err != nil { 38 | return nil, fmt.Errorf("read %q: %v", name, err) 39 | } 40 | if clErr != nil { 41 | return nil, err 42 | } 43 | 44 | return buf.Bytes(), nil 45 | } 46 | 47 | type asset struct { 48 | bytes []byte 49 | info os.FileInfo 50 | digest [sha256.Size]byte 51 | } 52 | 53 | type bindataFileInfo struct { 54 | name string 55 | size int64 56 | mode os.FileMode 57 | modTime time.Time 58 | } 59 | 60 | func (fi bindataFileInfo) Name() string { 61 | return fi.name 62 | } 63 | func (fi bindataFileInfo) Size() int64 { 64 | return fi.size 65 | } 66 | func (fi bindataFileInfo) Mode() os.FileMode { 67 | return fi.mode 68 | } 69 | func (fi bindataFileInfo) ModTime() time.Time { 70 | return fi.modTime 71 | } 72 | func (fi bindataFileInfo) IsDir() bool { 73 | return false 74 | } 75 | func (fi bindataFileInfo) Sys() interface{} { 76 | return nil 77 | } 78 | 79 | var _license = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\x5c\x51\x4f\x8f\xa3\x36\x14\xbf\xfb\x53\xfc\x34\xa7\x19\x89\x4e\xa7\xab\x1e\xaa\xde\x3c\xe0\x04\xab\x60\x47\xc6\xd9\x34\x47\x02\xce\xe0\x8a\xe0\x08\x3b\x1b\xe5\xdb\x57\x8f\x64\x76\xbb\x3d\x21\xfc\xde\xef\xef\xb3\x83\x43\x2d\x2d\x2a\xdf\xb9\x29\x3a\x3c\xd7\xd2\xbe\x30\x96\x87\xf3\x6d\xf6\x1f\x43\xc2\x73\xf7\x82\x2f\x6f\x6f\x7f\xfc\xf2\xe5\xed\xb7\xdf\xc1\xa7\x7e\x76\x37\xd8\x76\x6e\xa7\x14\xc3\x37\xc6\x36\x6e\x3e\xf9\x18\x7d\x98\xe0\x23\x06\x37\xbb\xc3\x0d\x1f\x34\x76\x7d\x86\xe3\xec\x1c\xc2\x11\xdd\xd0\xce\x1f\x2e\x43\x0a\x68\xa7\x1b\xce\x6e\x8e\x61\x42\x38\xa4\xd6\x4f\x7e\xfa\x40\x8b\x2e\x9c\x6f\x2c\x1c\x91\x06\x1f\x11\xc3\x31\x5d\xdb\xd9\xa1\x9d\x7a\xb4\x31\x86\xce\xb7\xc9\xf5\xe8\x43\x77\x39\xb9\x29\xb5\x89\xf4\x8e\x7e\x74\x11\xcf\x69\x70\x78\x6a\x1e\x88\xa7\x97\x45\xa4\x77\xed\xc8\xfc\x04\x9a\x7d\x8e\x70\xf5\x69\x08\x97\x84\xd9\xc5\x34\xfb\x8e\x38\x32\xf8\xa9\x1b\x2f\x3d\x79\xf8\x1c\x8f\xfe\xe4\x1f\x0a\x04\x5f\x6a\x88\x2c\x05\x5c\xa2\xcb\x16\x9f\x19\x4e\xa1\xf7\x47\xfa\xba\x25\xd6\xf9\x72\x18\x7d\x1c\x32\xf4\x9e\xa8\x0f\x97\xe4\x32\x44\x7a\x5c\x5a\xcd\x28\xc7\xaf\x61\x46\x74\xe3\xc8\xba\x70\xf6\x2e\x62\xc9\xfa\xc3\xdd\xb2\x43\xd6\xcf\x54\x68\x7a\x54\x14\xe9\xe5\x3a\x84\xd3\xcf\x49\x7c\x64\xc7\xcb\x3c\xf9\x38\xb8\x05\xd3\x07\xc4\xb0\x28\xfe\xe3\xba\x44\x2f\xb4\x7e\x0c\xe3\x18\xae\x14\xad\x0b\x53\xef\x29\x51\xfc\x93\x31\x3a\x79\x7b\x08\xdf\xdc\x92\xe5\x7e\xe5\x29\x24\xdf\xdd\xeb\x5e\x0e\x70\xfe\x71\xd5\xc7\x28\x0e\xed\x38\xe2\xe0\x1e\x85\xb9\x1e\x7e\x42\xfb\x9f\x38\x33\xc9\xc7\xd4\x4e\xc9\xb7\x23\xce\x61\x5e\xf4\xfe\x1f\xf3\x95\x31\x5b\x0a\x34\x7a\x65\x77\xdc\x08\xc8\x06\x1b\xa3\xbf\xca\x42\x14\x78\xe2\x0d\x64\xf3\x94\x61\x27\x6d\xa9\xb7\x16\x3b\x6e\x0c\x57\x76\x0f\xbd\x02\x57\x7b\xfc\x25\x55\x91\x41\xfc\xbd\x31\xa2\x69\xa0\x0d\x93\xf5\xa6\x92\xa2\xc8\x20\x55\x5e\x6d\x0b\xa9\xd6\x78\xdf\x5a\x28\x6d\x51\xc9\x5a\x5a\x51\xc0\x6a\x90\xe0\x83\x4a\x8a\x86\xc8\x6a\x61\xf2\x92\x2b\xcb\xdf\x65\x25\xed\x3e\x63\x2b\x69\x15\x71\xae\xb4\x01\xc7\x86\x1b\x2b\xf3\x6d\xc5\x0d\x36\x5b\xb3\xd1\x8d\x00\x57\x05\x94\x56\x52\xad\x8c\x54\x6b\x51\x0b\x65\x5f\x21\x15\x94\x86\xf8\x2a\x94\x45\x53\xf2\xaa\x22\x29\xc6\xb7\xb6\xd4\x86\xfc\x21\xd7\x9b\xbd\x91\xeb\xd2\xa2\xd4\x55\x21\x4c\x83\x77\x81\x4a\xf2\xf7\x4a\xdc\xa5\xd4\x1e\x79\xc5\x65\x9d\xa1\xe0\x35\x5f\x8b\x05\xa5\x6d\x29\x0c\xa3\xb5\xbb\x3b\xec\x4a\x41\x4f\xa4\xc7\x15\x78\x6e\xa5\x56\x14\x23\xd7\xca\x1a\x9e\xdb\x0c\x56\x1b\xfb\x1d\xba\x93\x8d\xc8\xc0\x8d\x6c\xa8\x90\x95\xd1\x75\xc6\xa8\x4e\xbd\xa2\x15\xa9\x08\xa7\xc4\x9d\x85\xaa\xc6\x4f\x17\xd1\x66\xf9\xdf\x36\xe2\x3b\x21\x0a\xc1\x2b\xa9\xd6\x0d\x81\x29\xe2\xe7\xf2\x2b\xfb\x37\x00\x00\xff\xff\x78\x07\xbb\x20\x40\x04\x00\x00") 80 | 81 | func licenseBytes() ([]byte, error) { 82 | return bindataRead( 83 | _license, 84 | "LICENSE", 85 | ) 86 | } 87 | 88 | func license() (*asset, error) { 89 | bytes, err := licenseBytes() 90 | if err != nil { 91 | return nil, err 92 | } 93 | 94 | info := bindataFileInfo{name: "LICENSE", size: 1088, mode: os.FileMode(0644), modTime: time.Unix(1572713988, 0)} 95 | a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x7a, 0x1e, 0xa, 0x4d, 0xf, 0xe, 0xe3, 0x22, 0x68, 0x1e, 0x6, 0xd3, 0x45, 0x5c, 0x95, 0x5e, 0x2d, 0x8d, 0x82, 0x4, 0xbb, 0x68, 0x44, 0xbd, 0xf1, 0x81, 0x36, 0x78, 0xd3, 0x48, 0xf3, 0xb2}} 96 | return a, nil 97 | } 98 | 99 | var _readmeMd = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\x94\x57\x6d\x6f\xdb\xc8\x11\xfe\xce\x5f\x31\x75\x81\x9c\x2d\x98\xa2\x6d\xb4\x81\xcf\x40\x81\xa6\xb8\xbe\x1c\x90\x43\xd0\xa6\x41\xd1\xd2\x46\xb2\xe2\x8e\xc8\x89\x96\xbb\x9b\xdd\xa1\x25\xe5\xd7\x17\xb3\x4b\x91\x92\x63\xa7\x57\x03\x26\x24\xce\x33\xcf\xbc\xec\xec\xcc\xa8\x09\xa8\x18\x4b\xdd\xb7\xc5\x1f\xa6\xbf\xa2\x78\x03\xb1\x43\x63\x20\x36\x81\x3c\x03\x3b\x58\x0d\x64\x34\xac\x95\x6d\xf6\xf0\xd3\x2f\x7f\x8d\xcb\xa2\x28\xde\xb3\xe2\x21\x82\xb2\x1a\x1a\x67\x39\xd0\x6a\x60\x72\x16\xbc\x33\xd4\xec\x8b\xf2\xbb\x7f\x45\xf1\xcf\x8e\x22\xf8\xe0\x3e\x63\xc3\x40\x11\x7a\x45\x96\x15\x59\xd4\xc0\x9d\xb2\x9b\x28\x76\xb9\xc3\x99\xdc\x85\x08\xdb\xce\x41\x44\xab\xc1\x0f\xc6\x40\xc0\x2f\x03\x46\x8e\x97\xc9\x0b\xeb\xb6\x70\xfe\x1e\x3d\xdc\x5c\x5d\xdf\x5e\xc0\x96\xb8\x4b\x04\x1d\x1a\x0f\x6e\x0d\xf5\x1f\x95\xb3\xf8\xf5\xe1\xbc\x63\xf6\xf1\xae\xaa\x5a\xe2\x6e\x58\x2d\x1b\xd7\x57\x49\x72\xb1\x2c\x8a\x7f\x21\x6c\xc9\x18\xe8\x31\xb4\x08\xca\xee\x4f\x2c\x89\x6b\x0c\x4a\xeb\x08\xd1\xf5\xc8\x1d\xd9\x16\x86\x88\xeb\xc1\x24\x17\xb4\xc3\x08\xd6\x31\xac\x02\xaa\x0d\xe0\x8e\x22\x0b\x24\x01\x47\x37\x13\xbd\x5b\x33\x5a\x68\x83\xb2\x0c\x8d\xeb\x7b\x62\x50\x4d\x83\x71\x8a\x3a\xa0\x77\x91\xd8\x85\xfd\xb2\x28\x7e\x5e\xc3\xde\x0d\x3f\x04\x71\x08\x54\xc3\xf4\x88\x62\x35\x64\x3e\xe1\x90\x33\x42\x50\x73\x16\xc3\x25\xb8\x00\x9f\x87\xc8\x13\xa0\xe9\x14\x5f\x82\x37\xa8\x22\x82\xcf\x9e\x83\x62\xa8\x5b\x62\xc6\xb0\xa4\xbe\x9a\x0b\xa2\x7a\xeb\x56\xab\xfd\x49\xae\x5e\xc0\x48\xd6\x8a\x9f\x6d\x64\x65\x8c\x92\x0a\x28\x4e\x0f\xba\x84\x7f\xbb\x01\x1a\x65\x81\x32\x48\xb2\x11\x0f\xc5\x35\x44\x71\xa4\xfe\x9b\xeb\x71\x15\x70\x3b\x1b\x94\x6f\xcb\xd8\x5d\xdc\x15\x05\xc0\xa7\x4f\x9f\x62\x57\x80\xa4\x75\x3b\xd1\x1c\x55\x6f\x42\x1c\x9b\xd2\x6e\x6b\x8d\x53\x3a\xe5\xb2\x36\x8a\xe5\xf0\x02\xa6\xd8\x9f\x2f\x00\xab\x03\xee\x1f\x89\x8f\xe3\x1b\x15\x62\x95\x09\x2e\x8e\x2d\x28\x13\x1d\x34\xc6\x59\x4c\x36\xd0\x32\x85\xe3\x63\x3b\xf1\xbb\x25\x1e\xb1\xbf\xd2\xf4\xb2\x25\x3e\x44\xf5\x21\xaa\x16\x8b\x31\x9b\x99\x71\x06\x42\xed\xbc\x24\x3d\x2e\x97\xcb\x07\xa8\xdd\xc0\x7e\xe0\xfb\x8f\x56\xf5\xb8\xd4\x7d\xfb\x00\x75\x74\x43\x68\xf0\xfe\xe3\xda\x19\x8d\xe1\xa1\x48\x9c\x6f\x24\x7f\xce\x32\x5a\x8e\x72\x37\x4e\x41\xb9\x46\x57\x72\xf7\x3c\xa1\x06\xb2\x63\x55\x6a\x8a\x1b\xa0\x5e\xb5\xb8\x2c\x8a\xc5\xe2\x5d\x36\x7d\xb7\x58\x14\xc5\x02\x00\x16\x8b\xb2\x7c\x74\x46\x8c\x43\x2d\xcf\x87\xbb\xc5\x02\x22\x32\x3c\x3a\x33\xf4\x08\x49\x72\xae\x29\x7a\xa3\xf6\x89\x38\xd1\xfe\x85\xac\x58\x8d\xa4\x71\xa5\xc6\xaa\x26\xab\xdd\x16\x98\xd8\xe0\xc5\x31\x39\x35\xce\x42\x2d\xcf\x25\x35\x36\x3e\xb5\x20\x82\x09\xbe\x52\xcd\xa6\x0d\x6e\xb0\x1a\x6a\x4f\xcd\xd2\xdb\x76\xc2\x8f\x91\x1e\x41\x52\x5c\x70\xee\x83\x7b\x24\x8d\xe0\x6d\x7b\x09\x2d\xad\x2f\xe1\xb3\x6f\x67\x17\xb2\x63\xa5\x77\x11\xea\x1d\xec\x27\xbe\x74\xee\xd2\xff\x24\xa0\x29\x8d\x82\x7d\xaa\x1a\xe9\x2b\x42\xbd\x25\xcd\x1d\x74\x48\x6d\xc7\x13\x49\x12\xb9\xf5\x77\x38\x18\x77\x3c\x32\xc8\xc7\xa4\x31\xa9\x1f\x92\x76\x10\xc0\xf9\xf5\x55\x79\xfd\x7a\x76\x5e\xb2\x33\x6a\xa7\x3c\x3e\xa7\x2d\x82\x38\xaa\x0f\x5e\x1a\xc7\xf5\xcd\xed\x29\x05\xd4\x6b\x32\xf9\x34\x1f\x5e\xc8\xc2\x21\x08\x32\xf8\x43\x3c\x3d\x95\x8e\x34\x96\xb8\x63\xb4\x91\x4e\xb9\x84\x45\xa4\xf9\x46\x4d\x08\xb7\x4e\x3c\x13\x41\x33\x44\x76\xfd\x37\x9e\x54\x75\x16\x24\x6b\x0f\x55\x1d\x55\xef\x4d\x76\xe1\x25\x2f\xd3\xf0\x9a\x95\x26\x0b\xca\xfb\x52\x07\xe7\x4b\x43\x76\x33\xeb\xf6\x6a\x23\x4d\x56\x24\x90\x24\xec\xe0\x8d\xf7\x86\x9a\xd4\xf8\xa4\xc1\x33\x18\x97\xbf\xc1\xee\x12\xf6\x13\xe3\x17\xf3\x6b\x09\xab\xb7\xb4\x0a\x2a\xec\xab\xbf\x0f\xd4\x6c\xde\x3a\xb7\xf9\x0e\x2d\x0e\x46\x41\x9d\x9e\x29\x4e\x21\x55\xcc\xaa\xe9\x40\x81\xa1\x06\x6d\xcc\x19\x38\xcc\x15\xe9\x96\x07\xe5\x80\x5f\xa1\x96\x87\x57\xdc\xe5\xe4\x78\x6c\x68\xbd\x3f\xe4\x44\xde\x8b\xe2\x3f\xf0\x2b\xb0\x73\x46\x86\x8e\x96\x17\x64\x1b\x33\x68\x3c\xb1\x30\xd1\x5a\x57\x92\x65\x0c\x16\xb9\x44\xab\x56\x06\x85\x5a\x53\x94\x8f\xa0\x06\x76\xbd\x62\x6a\xa0\x77\x83\xe5\x57\x8d\xf3\x73\x38\x6b\x17\x7a\xc5\xc7\x9e\xe4\x22\xb2\xca\x8c\xd7\x33\x23\xe0\x5c\xe3\x5a\x0d\x26\x6d\x0e\x1f\x7e\xfa\xcf\xbb\xb9\x3e\x95\xd6\x65\x0a\xb8\x66\x15\x5a\xe4\x43\x95\x1e\x62\xc9\x9d\xee\x69\x55\x28\xad\xe5\x3f\x55\x85\x32\x39\x63\xe7\xb9\xb3\xa6\x6e\xbf\xc2\x1c\x7b\x3f\x18\x26\xa9\x2a\xa6\x1e\xe3\x13\xab\xf9\xc2\xfe\x0f\xbb\xb9\x0b\xbf\x6c\x39\x93\xfc\x3f\xb6\xa5\x29\x97\x29\x3b\xe3\xd5\xde\x4d\x85\x7e\xda\xb3\xf3\xa5\xee\x95\x1d\x94\x31\x7b\x71\x6a\x07\xbf\xfc\x69\xbe\x97\x9a\x06\x26\x53\x3e\x62\x58\xb9\x98\x0e\x0d\x77\xd8\x0c\x8c\x30\x8a\xa4\x5f\x8f\x52\xe8\x9d\xc6\x6f\x54\xbf\x0c\x84\xfc\x82\x62\x92\x9d\xaa\x45\x65\xf5\xca\xed\xca\xa8\xd6\xcf\x9a\x4b\x2b\xdc\x08\x92\x35\xc9\x2b\xa6\x15\x19\xe2\xfd\xb8\x6d\xd9\xbc\x6c\x19\x8c\x71\x9e\x11\x18\xa4\x6b\xa4\x14\x74\xd2\x0d\xa5\x70\xc7\x97\x60\x87\x7e\x85\xe1\x80\xed\x2e\xa1\x2c\x65\x3d\x1c\x0b\x54\xa6\xd2\xb4\x32\x16\x45\xf1\xe7\x5d\x6a\x21\xc5\xb4\xcb\xe4\xe9\xfb\xdb\xdf\x54\x2b\xb2\x55\xec\x8a\xb4\x56\x94\xeb\xe3\x26\x50\x8e\xab\x10\x06\x99\xbf\xf0\xea\x15\x84\xfe\x65\xf9\xf1\x24\xbf\x2f\xe6\xe9\x79\x76\xa4\x01\x93\xc6\xd9\x01\x93\x5a\xdf\x99\x9a\x31\xf7\x1f\xa7\x89\x98\x41\x47\x73\xed\x8c\x0e\xfa\xf7\x1f\xe7\xd7\x32\x0c\x33\xf4\x68\xa2\xdd\x5c\x5d\xc1\xf5\xcd\xd5\xf1\xeb\x54\x33\xb7\x57\x57\xf0\xbb\xab\xfc\x7e\x9e\x21\xd7\x47\x6f\x4e\x3c\x5e\x2a\xef\xcf\x32\xd9\x8f\x19\xf2\xa4\xe7\x7f\x0b\x16\xd0\x69\xd7\x7d\x2d\xea\xb7\xbf\x87\xfb\xe2\xec\xc5\xf4\x89\xde\x59\xbe\x59\xe3\xea\x52\x9d\x1d\x16\x1c\xe9\x40\x4a\x56\xe5\xf8\x64\x21\x5d\x40\x6d\x9d\x46\x31\x27\x1b\xd2\x73\xdb\xe0\x5b\xb2\x43\xfc\x50\x1d\xc1\xe4\xba\xd5\xba\x6f\xd3\x2f\xa1\x59\xc7\xef\x3d\x2d\xfd\x9e\x3b\x67\x97\x2e\xb4\xe9\x7b\x75\x80\x89\x4e\xc4\x3c\xcd\xea\xf7\xac\x9a\xcd\xbb\x47\x0c\x6b\xe3\xb6\x90\x7e\x4d\x90\xb3\x99\xe9\xae\xaa\xa2\x88\xdd\x28\x4e\x3e\x1c\x20\xb1\xfa\xf1\xf5\xed\xed\x4d\xd5\xb9\x6d\xa9\x5d\x49\xe5\x58\x32\xaa\xb4\xd4\x60\x69\x9c\xdb\x90\x6d\xa5\x82\xa4\x7d\x96\xbd\x6a\x4a\x17\xcb\x5d\x99\x36\xeb\x52\x7e\x5c\x28\xab\x25\xa5\x58\xca\x55\x88\x17\xc5\x7f\x03\x00\x00\xff\xff\x2e\x13\xa9\x6e\xf7\x0d\x00\x00") 100 | 101 | func readmeMdBytes() ([]byte, error) { 102 | return bindataRead( 103 | _readmeMd, 104 | "README.md", 105 | ) 106 | } 107 | 108 | func readmeMd() (*asset, error) { 109 | bytes, err := readmeMdBytes() 110 | if err != nil { 111 | return nil, err 112 | } 113 | 114 | info := bindataFileInfo{name: "README.md", size: 3575, mode: os.FileMode(0644), modTime: time.Unix(1572713988, 0)} 115 | a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x9e, 0xc8, 0xca, 0xc6, 0x13, 0x2b, 0x80, 0x94, 0x3d, 0xb8, 0xd, 0x2e, 0x81, 0xcd, 0x9f, 0xe, 0x3d, 0xc9, 0x96, 0xfb, 0x6c, 0x4d, 0x58, 0xf7, 0x42, 0x97, 0x1d, 0x99, 0x34, 0x21, 0xb6, 0x7c}} 116 | return a, nil 117 | } 118 | 119 | var _builderCreateDmgBuilder = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\x7c\x90\xcd\x6a\xc3\x30\x10\x84\xcf\xbb\xef\x91\xa3\x93\x43\xaf\xa5\xd0\x1f\x17\x0c\xc5\x36\xb6\x92\xd2\x1a\x51\x94\x68\xed\x0a\xa4\x5a\x48\x32\x84\x3c\x7d\xc1\x22\x8d\xdc\x86\x1e\x35\xfb\xcd\xec\x68\xdb\x9c\x81\xb0\xf6\xe3\x4b\x18\x82\x83\x23\x11\x28\x93\x66\x40\xdc\xe5\x4d\x5b\x54\x65\xa2\xad\x0f\x93\x4b\x9e\xf0\x49\x42\xfa\x8d\x11\x3e\x90\x43\x2c\xf3\xd7\xa7\xa2\x81\xfd\xa4\xb4\x5c\x4b\xe5\x20\x90\xb1\xb0\xca\x66\x01\xb2\x19\x78\x2e\x5e\xf2\x34\xf0\xa4\x2c\xf4\x24\xc2\xe4\x48\xc2\x6a\x7e\xae\x10\xf1\xb1\xaa\xdf\x58\x05\xdd\x4f\x16\x47\x28\x4a\x56\xa5\xcb\xbb\x65\x2f\xbe\x49\xba\x47\xd8\x0b\x63\x35\xfd\x05\xa3\x7e\x86\x26\x6b\x47\x17\xae\x50\x71\x80\x80\xed\xf6\xa1\x65\xbb\xfb\xa6\x4d\x0a\xdd\x0a\x1d\xc8\xdd\xa5\x5b\xa1\xeb\x38\x47\xc4\xf7\xa2\x5e\xa4\x9d\x94\x3d\xd7\x8f\xfe\xac\x57\x9a\x7c\x66\x1d\xf5\xea\xc8\x17\xbf\x44\xac\xb7\x0c\x0c\x0d\x62\x3f\x1e\xe3\xe5\xfc\xaf\x7b\x5d\x23\x62\x82\x1e\x87\xe8\xf7\x37\xff\x58\x2f\xc3\x8b\xeb\x3b\x00\x00\xff\xff\xda\x50\x2e\xe6\x04\x02\x00\x00") 120 | 121 | func builderCreateDmgBuilderBytes() ([]byte, error) { 122 | return bindataRead( 123 | _builderCreateDmgBuilder, 124 | "builder/create-dmg.builder", 125 | ) 126 | } 127 | 128 | func builderCreateDmgBuilder() (*asset, error) { 129 | bytes, err := builderCreateDmgBuilderBytes() 130 | if err != nil { 131 | return nil, err 132 | } 133 | 134 | info := bindataFileInfo{name: "builder/create-dmg.builder", size: 516, mode: os.FileMode(0644), modTime: time.Unix(1572713988, 0)} 135 | a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x45, 0x19, 0x22, 0x65, 0xf3, 0x99, 0x89, 0x73, 0x97, 0xd7, 0xcb, 0x8f, 0x52, 0xdf, 0x52, 0x7f, 0x54, 0x38, 0x3f, 0xee, 0x5f, 0xfc, 0xda, 0x21, 0x63, 0x94, 0xf9, 0x7, 0xd3, 0x15, 0x6d, 0x60}} 136 | return a, nil 137 | } 138 | 139 | var _createDmg = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xcc\x5a\xef\x76\xdb\xb6\x92\xff\x2c\x3e\xc5\x94\xe1\xa9\xad\xd6\x94\x2c\xb7\xcd\xed\xc6\x51\x76\x65\x4b\xb1\xb5\xb1\xe5\x5c\xc9\x6e\xd2\x26\x59\x05\x22\x21\x09\x57\x24\xc1\x12\xa0\x6d\xc5\xd1\x39\xfb\x1a\xfb\x7a\xfb\x24\x7b\x06\xe0\x7f\x51\x76\xba\xbb\x1f\x6e\xce\x89\x25\x81\xf3\x1f\xc0\xcc\x0f\x03\x3e\xfb\xae\x3d\x63\x41\x7b\x46\xc4\xd2\x30\x9e\xc1\x69\x44\x89\xa4\x40\x20\xa2\xc4\xb5\x79\xe0\xad\xc1\x65\x62\x05\xcc\x27\x0b\x0a\x7c\x0e\x72\x49\xc1\xe1\x81\xa4\x81\x14\xf8\x9b\xc0\x9c\x7b\x2e\x8d\x0c\x43\x50\x09\x36\x3d\x36\x8c\x79\x1c\x38\x92\xf1\x00\xc2\x38\xa2\xd3\x5b\x1a\x09\xc6\x83\xfd\x26\x3c\x18\x0d\xea\x2c\x39\xec\x75\x5a\x87\xad\xc3\xd6\xf3\x3d\x63\x53\x20\xde\xa6\x33\x1d\x65\x8c\xed\xfa\x0b\xb0\xf6\x8b\xc2\x9a\x66\x89\x35\x16\x64\x41\x35\x63\x42\x90\x4a\xd0\xee\x08\xb4\x92\x04\xce\x1a\xfa\x97\x67\x30\x67\x1e\x6d\x99\x29\xc5\x0d\xf2\xbe\x00\xb0\xf6\x67\x44\xd0\x80\xf8\x14\xac\xc3\x26\x7c\xe0\x21\x8a\x16\x9f\xe0\x25\x8f\x65\x18\xcb\x29\x3e\x6a\xb9\xfe\xe2\x15\xbc\x14\x3c\x8e\x1c\x3a\xd5\x8e\xbf\xca\x44\xf5\x3c\xaf\x14\x9a\x12\x19\xdc\x31\xcf\x83\x19\x06\x2f\x64\xd4\x05\x16\x48\xae\x82\x99\x87\x37\x37\xea\x4a\x2b\x7f\x91\x0d\x00\xd8\xf6\x2d\xf7\x94\x79\xf8\xa7\xf0\x00\xff\x61\xe8\x6f\xb9\x17\x27\x4f\x61\xdf\x65\x22\xf4\xc8\x5a\xe9\x51\x5a\x5e\xb3\x00\x8d\x10\xcc\xa5\x33\x12\x01\x09\x5c\xb8\x63\x81\xcb\xef\x40\x32\xe9\xd1\x66\x55\x13\x73\x78\x00\xf8\xa7\xc5\x9c\x40\xec\x56\x87\x24\x25\xde\x19\x71\x56\x8b\x88\xc7\x81\x0b\x21\x73\x5a\x61\xb0\xa8\x61\x4e\x42\x52\xa0\xd5\xeb\x6b\x3f\x8c\xf8\x2d\x73\x29\x84\xc1\xe2\x00\x16\x6c\x7e\x00\xff\x08\x17\x65\xe3\xb4\xd9\x76\xc8\x05\xdc\xc3\xba\x46\x78\xc8\x05\x53\xcb\x02\xfd\xce\x82\x8f\x4c\x75\x72\x04\xfb\x42\xe1\x8e\xb9\x72\x09\x4b\xca\x16\x4b\x59\x23\x51\xd1\x24\x6b\x7f\xb7\x40\x49\xef\xa5\x16\x87\xdf\xa6\xf8\xad\x46\x56\x1a\x75\x7a\x9f\xc8\xdd\xef\x1c\xda\x9d\xe7\x65\x1f\x31\xaa\x5a\x14\x7e\x7b\x42\x14\x92\x88\x44\x56\x1c\x82\xe4\xd0\x39\xfa\x75\x5b\x9e\x5a\xf7\x6a\x15\x3f\x15\xb7\xd4\x53\xe6\xd1\x3d\xb1\x3d\xc3\x4b\xe6\x52\x9b\xde\x4b\x1a\xe0\x4e\xcb\xc5\x56\x44\x22\x99\x92\x93\x93\xf2\xb9\xa2\x2e\x49\x73\x62\x21\xb9\x5f\xb5\x50\x8f\x4e\x95\xf7\x3c\x9a\x0a\xe2\x87\x1e\x9d\xe2\xf3\xa7\x8c\xc7\x95\xad\xb9\xb7\x2d\x27\x61\x68\xbb\x11\x0f\x6d\x8f\x05\xab\x1a\x41\x3e\x59\x61\xea\x43\x12\x50\x24\x92\x43\x2f\x0c\x3d\xe6\x10\xb5\x1f\x0f\x80\x48\xf0\xb8\xfe\x05\xf7\x07\xeb\x92\xf4\x3f\xbd\xbf\x2c\x3c\x16\x34\x82\xbf\xc7\xcc\x59\x5d\x70\xbe\x02\x16\x08\x49\x3c\x0f\x5c\x16\x3d\xae\x8a\xc6\x1e\x01\xfc\x33\xad\xc4\x13\xff\x11\x29\x89\xb3\x04\x02\x1e\x73\x68\x20\xf4\x44\x42\x9a\x6d\xfc\x45\x49\x52\xc0\x6d\x16\x48\x1a\x05\x54\xda\x34\x20\xb3\x2d\x69\x2e\x13\x38\x0a\x24\x96\xdc\x27\x92\x39\xe0\xf3\x38\x90\xdf\x3b\x3c\x2c\xdb\x34\xe7\x91\x4f\xb6\x76\x4f\x48\x1d\x36\x5f\x27\xeb\x29\x20\x5e\xb2\xd1\x35\x31\xec\xbb\x74\x4e\x62\x4f\x02\x13\x70\xd3\xff\xe3\xaa\xbc\x6a\x89\xeb\xda\xda\x76\x12\x2d\xa8\xce\xc0\x10\x12\xb9\x9c\x4a\x3e\x4d\x93\x6b\xfd\x92\x20\xae\x8b\xff\xd5\x92\x20\x9e\x8e\xc0\xbe\x4e\xe9\xe0\x90\x00\xf3\x70\x2c\xa8\x0b\x7e\xec\x49\x16\xa2\x0a\xe6\x53\x51\xa3\x5e\xef\xf6\xc7\x0c\xd0\x14\x4f\x9b\xa0\xe9\xfe\xaa\x11\x58\x1d\x6c\x15\x33\x9d\x0f\xee\x6b\xd6\x7e\xb9\x8a\xe8\x4c\xe0\x93\x20\x26\x9e\xb7\xc6\x79\xbf\x87\xcb\x93\xf2\x0e\x76\x59\x2c\x99\x67\xdf\xd2\x68\xc6\x45\x75\xc6\xe9\x3d\x75\x62\x49\x21\xa1\xc2\x0a\x92\x10\x82\xcf\x5d\x6a\x02\xd4\xc9\xfa\x33\x66\xb4\x3a\xfb\x35\x92\x14\x99\x96\x53\x94\x22\x48\xe0\xce\xf8\xbd\x2d\xc8\xfc\x29\x73\xee\x98\x5c\x42\x42\x0f\x0e\xf7\x43\x22\xd9\x8c\x79\x4c\xae\xd5\xde\x77\x39\x04\x5c\xc2\xcc\xa3\x42\x94\x54\x44\xf4\x0b\x44\xf4\xcb\x14\xe7\xaf\xa2\x22\x16\x69\xc6\x51\xb3\x8b\x31\x1b\xd3\x2f\x20\x39\xf7\xca\x75\x51\x83\x0b\x48\xff\x89\x25\x66\x72\xce\xbd\x14\xbc\x40\x10\xfb\x33\x1a\x15\x99\x96\x07\x18\x24\xea\x85\x29\x53\x52\x9a\x41\x2e\x99\x00\x7c\x80\xd4\xf7\x4c\xc2\x21\x62\x9a\x77\xc3\xd1\xfb\x6e\xe7\x10\x3f\x7f\xef\x3e\x57\x9f\xef\xba\xbf\x1c\xaa\x2f\xe7\xdd\x9f\x7e\x39\x34\x86\xa7\x57\xa3\xe9\x64\xf8\xc7\xa0\xdb\x39\xfa\xd5\xb8\x1e\xbc\xbf\x4e\x7e\x3d\x37\x5e\x5f\x8d\x2f\x7b\xd7\x5d\x13\xb7\x92\x69\xf4\xfa\xfd\xe9\xeb\xe1\xc5\x60\x3a\xb9\xba\x19\x9f\x0e\x26\xdd\xfd\x66\x3e\x76\xdd\x1b\x9f\x0d\xae\xf3\xb1\xab\x8b\xfe\x60\xbc\x45\xa9\x47\x0b\xb4\xc3\xcb\xde\xd9\xe0\xcd\xe0\xf7\xae\x69\x1a\xe7\xfd\xe1\xcd\xf5\xf0\x62\xfa\xdb\x60\x7c\x72\x35\x19\x5e\xab\xc1\x49\x6f\xd4\x3f\xb9\x7a\x3f\x9d\xf4\x5e\x0f\xba\x87\xc6\xe4\xcd\xf0\xed\xf4\xdf\x07\xa3\x37\xc3\xd1\xa4\x7b\x68\x18\x77\x4b\xb5\x9f\xa9\x90\x60\x5a\x0f\x9d\x17\x87\x2f\x3a\x1b\x13\xba\x60\xda\xe6\x31\xb8\xdc\x68\x38\x44\x50\xb0\x3a\xc0\x02\xa3\x91\x41\x9e\xa6\xd1\x68\xfc\x76\x75\x71\x73\x39\x98\x8e\x7a\x97\x83\xae\x69\x1d\x99\x46\xa3\x21\x96\x6c\x2e\x8f\x41\x7f\x1c\x27\xf4\x98\xf4\x0b\xf4\x2a\x5a\xe8\xf1\x6e\xa6\x1c\x85\x20\xdf\x49\xef\xf4\xcd\xd9\xf8\xea\x66\xd4\x2f\xb1\x55\x86\x53\x3b\x0a\xa0\xb1\x42\xd1\xac\x70\x9d\x5e\xf4\x6e\x26\x83\xae\x89\x1b\xb6\x8c\x91\x64\x1c\x29\x74\xc1\x43\x29\x70\xe9\xa9\x64\xf5\xd1\x6c\xe5\x54\x2f\xaa\xc2\x95\xfa\x8f\x26\xaa\x18\x0f\xde\x62\xf0\x87\x57\xa3\xe9\xf9\xb0\xdf\x1f\x68\x6f\x27\x25\x7d\xc5\xca\x4e\x6f\x69\xb4\x06\x26\xa9\x8f\xba\x1e\xe4\x92\x9e\x70\x29\xb9\x3f\x46\xec\xf3\x1e\x7e\x84\xce\xe1\xe1\x01\xfe\xd9\xd4\x47\x2b\x83\x26\x18\xac\x7c\x2d\xee\x8c\x6e\x86\x8a\x90\x3e\x5f\xad\x3b\xe9\x73\x78\x87\x0c\x6a\x3b\x58\x47\xc7\xa0\xf6\x83\xf5\x53\x95\xa5\x86\x33\xd5\xa5\x76\x4e\xc2\x7a\xfe\x04\x6b\xba\x68\xb2\x50\xa6\xd1\xb3\x1e\x2a\x43\x9b\x6a\x3c\x55\x24\x3f\x9a\xd6\xd1\x47\x53\x05\xd4\xfa\xe9\x00\xac\x9f\x37\x46\xa3\xb1\xe5\x5f\x8d\xe2\x32\x96\x42\x13\xce\x87\xfd\xe1\xe8\xac\x60\x40\x69\x60\x93\xe6\xfb\x1c\x54\x2d\x99\xeb\xd2\x3a\x53\x64\x14\xd3\x3a\x33\x94\xe2\x02\xec\x6a\x3e\x6e\x67\x81\x6b\x09\x5f\x93\x64\x86\x3c\xea\xd4\x95\xec\xbb\xe4\x58\x66\x34\xd2\x03\xd8\x31\xe8\x9c\xa6\x9f\xe3\xd9\xad\x48\x54\x3c\xcb\x95\x29\x8b\x20\x0a\x29\xff\x7e\x31\xbd\x18\x8e\xde\x74\xad\x23\xfd\x63\xd7\xb2\x4e\x7c\xcf\xb0\x54\x3a\x1b\x47\x07\x60\xfd\xf4\xd8\x6c\x28\xad\x25\x60\x88\x6a\x7b\x6f\xdf\x5e\x0c\x4f\x7b\x6a\xe2\x73\xfd\xc5\xd1\x27\x0c\x29\xc2\xc6\xbf\x66\x0b\xc2\x3a\x34\x61\x70\x73\xd1\x9b\x8e\x27\xe3\x53\xad\x7b\x9b\x70\x1b\xba\x21\xdb\xe8\x6a\x38\xba\x1e\x8c\x47\x83\xeb\x6e\x27\x63\x53\xf4\x1a\x73\x21\x4d\x5a\x27\x76\xed\xc1\x14\x78\xa9\x48\x54\x2a\xc6\x8f\xdd\x7d\xe4\x2b\x3d\x4a\xca\x86\x7a\xf4\x93\xf9\x8d\x1b\x09\x35\x3f\xb5\x97\x7e\x3e\x00\xeb\x97\x6f\xd8\x4b\x5b\xc6\x2b\xb0\x95\xd9\x58\x2a\x63\x55\x07\x4a\x95\xef\x9f\xc3\x85\x0a\xe8\x43\x6b\xfa\xc3\xc9\x9b\xa9\xaa\xbe\x4f\xe4\xcf\x0a\xb6\x53\x29\x65\xab\x50\xef\xa5\x8f\xf7\xca\x4b\xa4\x04\xe6\x76\xb1\xaa\x87\x05\x46\x40\xce\x22\x80\x43\xc6\x12\x0e\xe8\x54\x88\x23\xfa\xa5\xa9\x4a\xd7\x1f\xd3\xb7\xbd\xeb\xf3\x5d\x0b\x5c\xac\x58\x68\xff\x83\x06\x2b\x16\xa8\x62\x50\x02\x13\xe5\xc5\xfd\x03\x3e\x4f\x1a\x3a\xc1\x2a\xe0\x77\x01\x24\x40\xdb\xea\xb4\x60\x1c\x07\x1a\x36\x26\x48\x6c\xce\x23\x85\xbc\x5a\x18\x42\x95\x7d\x3a\x28\x85\x0a\xe2\xa4\x08\x44\x6f\x11\x05\x43\xd4\xc1\x04\x8b\x5d\x86\x7d\xf4\xdc\xac\xe8\x1a\xbe\x78\x6c\x66\x7b\xf4\x96\x7a\xdd\x7f\x31\x51\xc6\x4d\xff\xe4\x8f\x5d\xc4\xb3\x2f\x2c\x3c\x2a\x51\x2b\x8d\x2e\x0f\xa8\x61\x28\x4c\x64\x7f\x01\x9c\x58\xf8\xfe\xfb\xbc\x09\x36\xe2\x12\x68\xc0\xe3\xc5\x12\x48\xb4\x88\x7d\x1a\x48\xd1\x82\x61\x70\xcb\x57\x74\xa7\x57\xda\x29\x04\x94\x93\xd3\xf1\xf0\xed\xf5\xb4\x3f\x1c\x23\x5c\x01\xc7\x05\xfc\x70\x59\xa4\x50\x8b\x69\x3d\x9c\xf4\x26\xe7\xc9\xf2\xff\x70\xf8\x69\x63\x42\x53\xe9\x0f\xef\x5c\x68\x9a\x46\xff\xf2\x4c\xcf\x91\x69\x75\xf4\xaf\xfe\x70\x9c\x82\x9f\x5c\x4a\x4a\x66\x36\x33\x22\x24\x50\xda\x0a\x4c\x26\xbc\x82\xb6\x4b\x6f\xdb\x41\xec\x79\xc7\xa8\x23\xa1\xdf\x82\x53\xdb\x22\xaf\x07\x97\x6f\x53\xba\x44\x64\x3b\xba\x6b\x59\x0f\x29\xff\xc6\x34\x26\xe3\xd3\x64\x43\x67\xda\x8f\x6a\x75\x16\xc2\x5d\x00\x96\xca\xf1\x32\xd0\xac\xb5\x08\x5a\xae\xbf\x40\x29\xcf\x60\x16\xd1\x3b\x75\x9a\xc5\x13\xb9\x6a\xf1\xe9\x0a\xcd\x04\x10\x01\x1d\x75\x24\xa1\xfe\x8c\xba\xaa\x6a\x8b\x38\x0c\x79\x24\x41\x38\x11\x0b\xa5\x30\x4e\xc6\x83\x77\xd3\xe1\x68\x72\xdd\xbb\xb8\x40\x78\xdc\xbb\x79\x9f\x46\x3b\x9f\xb7\x76\xc2\x65\x1a\x06\x9b\xc3\x07\xb0\x8a\x5c\x60\xd3\x3f\xe1\x10\x3e\x1d\xa3\xfc\xc0\x68\x68\xbf\xd0\xf1\x54\x96\x09\x5f\xbf\xe2\x6a\x4a\x3b\xa2\x24\xc0\xf3\xd1\x9c\x05\x6e\x66\x8e\xcb\x22\xea\x48\x1e\xad\x5f\x40\xce\x96\x6d\x0d\xa3\xb1\x31\xe6\x2c\x51\x6e\xcf\xc1\xb4\xf2\x30\xb7\x5b\xfd\xc9\x74\x22\x79\x44\xcd\xdc\x06\xad\xa8\x4f\x3d\x2a\x59\xb0\x00\x12\xac\x21\x23\xc3\x33\xa0\x3e\x39\x27\x27\x62\xd3\x68\x44\xfe\x2e\x99\x4a\x6f\xd6\x94\xc6\x08\xaa\xcd\x64\x14\x9a\xbb\xa8\xa1\xd0\x42\x6d\xb5\xcc\x64\x6e\xd1\xd0\x87\xd2\xc2\xd9\xa8\xf9\x8d\xfc\xfa\x67\xa8\xe8\x46\xa0\xb8\x4b\xba\x20\xb3\xb5\xa4\x02\x04\x0b\x9c\xfc\xe4\x39\x27\xcc\x13\x7a\xcb\x29\x10\xed\x91\x68\x41\xe1\x64\x2d\x69\x72\xee\x13\x79\x4b\x7a\xe6\x71\x67\x25\xa6\x92\x4f\xfd\x54\x9a\x6e\x50\x3f\x83\x9e\xeb\x42\x07\x01\x5c\x44\xe0\xf2\xe4\x20\x51\x22\x97\x34\xa2\x7b\x02\x02\x0e\x2e\x75\x98\x4f\x3c\x88\xa8\xa4\x81\x92\x86\xcf\x8c\xc6\xe5\x89\xce\xfd\xd6\xfe\xfe\xbe\xd5\x81\x1f\xe0\x97\xce\x11\xb4\x11\xab\x1f\x26\x1f\x4d\xc4\xef\xcd\x66\x32\x05\x56\xc2\x50\xea\x95\x2f\xa8\x6e\x4d\xa6\xd6\x9c\xe1\x79\x04\x8d\xd5\x7d\x03\x16\xa8\x68\x1a\x0d\x65\xb2\xa2\xec\x7e\x76\x63\xb0\x05\x60\x06\x80\xaf\x20\xa8\x0b\x36\x85\x3d\xd1\x6e\xb4\x7e\x68\xb7\x17\x7b\x9f\x13\x75\x9f\x6b\x7c\x06\x2b\x97\xf3\x19\xed\x28\x4d\x66\xff\xf2\x4c\x87\x53\xed\x0d\xd5\x2a\x62\xd4\x4d\xda\xad\x91\x1a\x4d\x63\x4f\x85\x64\xbe\x82\x53\xc6\xe9\xcd\xe4\xfa\xea\x52\x87\x62\x6f\x0f\x97\xe5\x77\x90\x6f\xe7\x4a\xa1\x34\xd3\x45\x59\xe4\x32\x75\x2f\xc5\x7a\xa8\x10\x6f\x7c\x33\x5f\xe9\x56\xb1\x84\x55\xb7\x59\x6a\x96\xbe\xa1\x00\xeb\x61\xab\x50\x6e\xc0\x16\x91\x93\x74\x7d\x8a\xcb\xdb\x84\xac\x93\x6f\x5a\x0f\x85\x6c\xb3\x31\xc1\x9e\x0b\x38\x7f\x3d\xf9\x11\xbf\x90\x68\x21\xc0\xb4\x1d\x70\xba\xcf\x7f\x3e\x20\xdd\xce\xf3\x03\xda\xed\x3c\x47\x22\xdd\x3c\xbb\xe9\x8f\xdf\x81\xf5\x50\x70\x6c\x53\xb7\xac\xa9\x27\x68\x23\xb7\xd8\x27\x2b\xba\x5c\xcf\x22\xe6\xee\xb0\x3a\x69\xc9\xd9\xba\xc1\x6f\xef\x30\x74\x39\x17\x60\xf3\xba\x2d\x56\xf2\xb5\x10\x29\x1e\xdc\xd2\x48\x96\xad\xb7\xf9\xed\x4e\x29\x5b\x8e\x54\x31\xd0\x54\x7b\xde\xad\x4e\x79\x92\x34\xce\x92\x93\x92\x9e\x22\x57\x2d\x36\xe2\xc8\x98\x78\x6a\x81\x19\x55\x44\xf5\x39\xdd\x19\x35\xba\x3f\xeb\xe4\xa0\x57\x6d\xd2\x29\xd2\xdb\x65\x0e\x33\xb6\x58\xd0\x68\xd7\x9a\xe9\xc0\x27\x4c\x3a\x1f\xe0\xbb\xda\xe5\x99\xf8\x60\xa6\x54\x3b\x9e\x83\xbd\x90\x5b\xcf\xf2\xd5\x58\x75\x65\x87\x94\x24\x30\x03\xbd\x95\xb4\x33\x85\x0e\xa5\xe0\x51\xec\x50\x7d\x93\x50\xdd\x55\x55\xa8\x9f\x6d\x2b\x04\x1d\x0c\xb3\x86\x69\x3d\x7c\x57\xa5\xfa\xf0\x6f\x9f\x70\xde\x5c\x8e\xe0\x4d\x0d\xd5\x84\x7a\x8b\xc9\x62\x9f\x30\xe2\xdb\x98\xd7\xda\xa7\xf7\x61\xb4\x1d\x87\x1f\xc1\x2a\x48\x6f\xa2\xc2\x80\xa2\xb3\x75\x4e\x94\xe0\xfe\x23\x6e\x94\xe8\xbe\xdd\x91\x32\xdb\xff\x9f\x2b\x86\xae\x1b\xba\x6a\x88\x90\xa8\xfa\x19\x15\xa7\x2f\xa2\xba\xae\x8a\xad\x95\xbd\x5b\xd9\xd1\x61\x13\x25\x8f\xa9\xbe\xb6\x4a\xeb\xab\x12\x9d\x74\x19\x50\x9d\x8c\xe7\x73\x23\xdd\xc8\x11\x4d\x92\x67\x6d\xca\xdb\x91\x57\x77\xd4\x5b\x75\x95\x00\x4c\x26\x05\xfd\x12\x7f\xd6\x14\xf4\xcb\xab\x9b\x51\x02\x61\xdb\xbf\xa9\xb4\x24\xda\x95\x8c\x84\xd2\x64\xb4\x86\x38\xd0\x32\x5d\x7f\x81\x9b\x93\x49\xb8\x23\x42\xeb\xa1\x2e\x84\x11\xbd\x65\x3c\x16\xde\x1a\xf6\x69\x6b\xd1\x02\x17\xc1\x38\x0f\x69\x94\x91\xb8\xfe\xe2\x20\xbd\x88\xa1\x2e\x90\x30\x54\x18\x6e\xce\xa3\x05\x97\xea\xce\x26\x48\xad\x6e\x1a\xe9\x89\xc3\xdf\x61\x78\x7f\xf0\x9b\x06\x92\xd6\x7e\xde\x03\x9f\x73\xf8\x0a\x74\x11\xd1\x10\x6c\xdb\xe1\x1e\x8f\xba\x01\xbd\xa5\x11\xec\xfd\x87\xc2\xa9\x7b\x49\x91\xed\xfc\x09\x5f\x81\xdc\xad\x60\xef\x21\x8c\x58\x20\xc1\xea\x6c\xf6\x9a\x46\x8e\xf0\x1e\xb2\xb8\x68\x64\x93\xaa\x70\xa9\xba\x00\xc2\x90\x27\xfa\x31\x3e\x85\x10\x97\x00\x5f\x26\xa4\xd6\xdc\xe4\x32\xc9\x8e\x28\x71\xef\x22\x26\x29\xd8\x01\xbf\xa5\x11\x9b\xaf\xf1\x1b\x89\x25\xe7\x21\x0d\xea\x52\xf8\xff\xc5\xc9\x14\x42\xde\x32\x47\x5f\x69\xbf\x50\xbd\x73\x2b\xb5\x50\x63\xe1\xe2\xe6\xae\x74\x48\xcd\x32\x18\x3d\xe5\xe1\x1a\xe7\xa7\xd0\x79\x55\xaf\x01\xe0\x24\x15\x30\x73\x16\x8b\x76\xa1\xfb\xaa\x00\xb4\xbf\x72\x59\xb4\x93\xc2\x68\x38\x61\x8d\x0d\xbb\xe8\xdb\xb5\xfd\xdc\x0c\x7b\x94\x72\x56\xa5\x11\x55\xf1\xcb\x27\x2b\x74\xab\xee\xb2\x12\x27\xd9\xcc\x90\x60\x6a\x86\xd1\xf0\x02\x04\x73\xed\x12\x69\xd1\xce\xe2\x83\x5a\x93\x92\x96\xdc\xe3\x96\xd4\x5e\x6a\xee\x36\xc7\x6c\x5f\xb0\x59\x44\xa2\x75\x3b\x63\x2c\x47\x2f\x1f\xae\x33\xa9\xda\xec\xdf\x31\xfb\x85\x77\x16\x74\x97\x7d\x6f\x8b\x73\x4f\x2f\x09\x35\x9d\x5b\x52\xcb\xf3\xa9\x33\xd1\xb0\xf0\x8e\xc4\x84\xca\xd7\x28\xd6\x76\x80\x39\xc1\xe9\x13\xe4\x75\xb3\xbd\xab\xcc\x96\xfd\x48\x10\x08\xba\x20\xb4\xbd\xdf\x5c\x86\xb5\xa0\x5d\x55\xd7\x68\xa0\xe7\x36\xd9\x4d\x51\xf2\xa9\x40\x94\x34\xd7\x52\x31\x59\xd9\xfa\xf6\x12\x5c\xef\xa2\xc2\xcf\x3b\x9d\xdc\x59\xa4\x4b\x6e\xd6\xd4\xe4\x2d\x47\x6b\x68\xea\x5c\x2d\x75\x12\xb7\x9c\x7d\x06\x51\x1c\x60\xc9\xf0\xa8\x3e\xe1\x1b\xb8\x7d\x07\xfa\x28\xdf\xb5\xf6\xfd\x95\xa4\x7e\x08\xb6\x4c\x41\xa9\xbf\x68\x49\x3f\x6c\xbd\xcf\xfe\x35\x0b\x27\xb5\x82\x9c\xe4\xb2\x59\x9f\xd9\x9e\x6e\x02\x34\x1c\x22\x0b\x1d\x80\x36\x6a\xf5\x88\xa4\xad\x82\x48\xdc\x8b\x9e\xa0\x09\xf1\xcb\x97\xb0\x37\xb8\x9a\xec\x19\x8d\xc6\x33\x48\x44\x5f\x0c\x47\x83\x69\xc1\x81\xe9\xdb\x8b\xde\xe9\xe0\x5c\x85\xc0\x18\x5c\x4d\x8c\xc6\x9c\xe1\x91\x2e\x41\xbe\x85\xe6\x5c\xd5\x9e\x6d\x4f\xf2\x73\xa4\x29\xda\xef\x86\xa3\xf7\x6d\x4b\xfd\x5d\x98\xf9\xd8\xef\x6a\xec\xf7\xd2\xd8\x3b\x35\xf6\xae\x34\x76\xae\xc6\xce\xf3\xb1\xad\x5b\xb7\x52\xbe\x4d\x86\x32\xea\xc7\x2f\xd0\xda\xd6\x13\xcf\x33\x39\xd9\x5d\x58\xdb\xca\xbf\x66\x4f\xb3\x9b\xaf\xb6\x95\x7f\x5d\x60\x91\x0c\x69\xe4\x81\x1d\x52\x40\xb2\x4a\x87\xb9\x6d\x55\x07\xca\x2c\xa6\x68\x67\x77\x22\x6d\x2b\xff\xba\x45\xb5\x7d\x73\xd1\xb6\x6a\xc6\xb6\xf8\x4a\x97\x4f\x6d\xab\xfc\xd3\x84\x57\xba\x40\x25\x0b\xc4\x34\x1a\xc2\xa3\x34\x84\x23\x78\x06\x21\x89\x85\x7a\xeb\xe4\x8e\x47\x2b\xa2\x4b\x2e\x77\x1c\x22\x34\x5a\x35\x4f\x49\xf0\xdf\xff\xf9\x5f\x12\x16\x54\x2a\xd4\x64\xc2\xbe\xdd\xf9\xdb\xd1\xaf\x4d\x60\x42\xc4\x54\xe4\x6f\x19\x8c\xe3\x20\xc0\x94\xd0\xcb\x57\xd1\x0b\x68\xc7\x22\x52\x2f\x2e\x72\x41\xf4\x18\x7c\xc4\xbd\x9c\x5b\xb3\xf9\x68\xaa\xa1\x22\x4c\x54\x57\xa6\xfb\x35\xbc\x15\x56\x73\xfb\xc4\xfb\xf5\x2b\xe2\xc9\x0f\x1f\xc0\xb4\xfe\xd5\x04\x3b\xa0\xb8\xc0\x93\x15\x0e\xda\xd0\xd7\x84\x21\x64\x8c\x8a\xf6\x4e\xf4\x66\x3b\x7e\x14\x9c\x25\x57\x60\xcf\x7f\x3e\x86\x39\x6b\x66\x0d\x34\x1e\xd0\x4c\x98\x3a\xab\xe5\x01\xd0\x09\x51\x47\xfb\xe7\xa4\x83\x56\x9a\x09\x9d\x8e\xd4\x3b\x47\x22\x8e\x28\x30\xa9\x7a\x4b\x12\xa7\xc3\x73\x41\x41\x39\x32\xf3\xd2\x56\xda\x6b\x76\x8f\x5a\x42\x1a\xf9\x4c\xe0\x14\xe9\x94\xeb\x2c\x7d\xee\x82\x3d\x9e\xc3\x82\xdb\x77\x5b\x90\xb3\xd0\x58\xc5\xf8\xa8\x0b\xc7\x82\xed\xf3\x6d\xa1\x66\x66\x15\x3a\x24\x79\x98\xbe\xc4\xa6\x40\x24\x93\x82\x7a\x73\xe0\x81\x46\xe3\x2f\xbe\xa1\x11\xa3\xd5\x9d\x78\x54\xa8\xd6\x9d\x90\x24\x92\x14\x01\x99\x7a\x01\x44\xbd\x96\x94\x74\x60\x4a\xa6\xdb\x36\x2a\xac\x7d\xb6\x25\x73\xce\x02\x26\x96\x28\x54\x27\x4c\xfd\x78\xb2\x62\x61\xa8\x20\x65\x4a\xc7\x83\xf4\xb5\x94\xbf\x86\x51\x9e\x81\xa4\x9e\xa7\x02\x92\x00\x14\xb9\x24\x78\xbe\x80\x25\x11\x40\x74\x63\x2c\x7d\x89\x89\x48\x19\xb1\x59\x2c\x69\x01\x6d\x10\x28\x41\x8d\x74\xf2\x93\x83\xca\x93\x87\x94\xc7\x8f\x0d\xcf\xd4\x3b\x36\x11\x06\xb3\xd4\x7b\x4d\x06\x1f\x91\x97\x76\x7c\x6a\x4f\x8a\x35\xe7\x85\xb4\x33\x64\x3d\xe8\xcb\x97\x0d\x58\x0f\xe9\x35\xca\xa6\xd0\x26\xc2\x59\x6a\x97\xda\xfe\x8f\xb5\x74\xf1\x84\x1c\x2c\x60\x70\x73\xd1\x2b\x1c\x91\xd5\xc2\x4a\x5a\x32\x0f\xd9\x4d\x2b\x1a\x41\xaa\x23\xdf\x75\xc1\xb4\x71\x89\xdb\x5b\x2d\xee\x5a\xd9\xa6\x61\xa8\x9b\xad\xde\xf8\xac\x8b\xe9\xa6\xa4\x2a\xbd\xf2\xca\x34\x15\x06\x6a\x15\xe5\xa2\xf4\x1b\x4c\x45\x0e\x55\x80\xbf\x05\x0e\x60\x76\x4b\xb0\xc0\xa6\xed\xfa\x0b\x3b\x79\x33\xb0\x15\xae\xcd\x9d\x51\xad\xc6\x41\x6b\xee\x8d\xcf\x36\x19\x72\x08\xd7\x72\xc9\x03\xb0\xff\x17\x32\xe0\xe5\x4b\xbb\x1e\x71\x5c\x0c\x4f\x07\xa3\xc9\xa0\x16\x6d\x64\xcd\xd9\x34\x9e\xf9\x6d\x77\x16\xd1\xd2\x50\xb7\x0b\x9d\xea\xac\x61\x16\x14\x54\xaa\xad\xb0\x57\xb9\x41\xdf\x83\xe4\xbd\x61\xf5\x9e\xa4\x76\xf3\x19\x38\x4b\xea\xac\x30\xfd\xa7\x4b\x3b\xb9\x38\x11\x50\x61\x47\xe2\xf4\x52\xe5\x8e\x08\x88\xa8\xcf\x6f\xf5\x4b\xd8\x3e\x71\xae\x26\xd0\x39\x6c\x75\x7e\x41\xaa\xa5\x94\xa1\x78\xd1\x6e\x2f\x98\x5c\xc6\xb3\x96\xc3\xfd\x36\x09\xdc\x88\xae\x6f\x99\x6c\xe7\xef\xbd\xb7\x75\x31\x6c\xff\xed\xb9\x9a\xe8\xbc\x89\x50\x52\x0b\xfa\x02\xf0\x55\x9e\x8d\x8f\x0a\xdf\x8d\x46\xb2\x0c\x76\x72\xaf\xa9\xd8\xbd\xb9\xd2\xc9\xd6\xc1\xcb\x92\x05\xa7\xba\x9e\xa4\xee\x56\x84\xb6\x60\xc4\x25\x4d\xfb\x2f\xf5\x71\x68\x99\xd9\xa4\x26\x55\x23\x7f\x89\x11\x31\xb5\x69\x24\xef\xc5\xfd\x4f\x00\x00\x00\xff\xff\xcc\xca\xc0\x81\xa4\x30\x00\x00") 140 | 141 | func createDmgBytes() ([]byte, error) { 142 | return bindataRead( 143 | _createDmg, 144 | "create-dmg", 145 | ) 146 | } 147 | 148 | func createDmg() (*asset, error) { 149 | bytes, err := createDmgBytes() 150 | if err != nil { 151 | return nil, err 152 | } 153 | 154 | info := bindataFileInfo{name: "create-dmg", size: 12452, mode: os.FileMode(0755), modTime: time.Unix(1572713988, 0)} 155 | a := &asset{bytes: bytes, info: info, digest: [32]uint8{0xb, 0xe0, 0xd5, 0xb4, 0xd, 0x7e, 0xb6, 0xd, 0x8c, 0x18, 0x4d, 0xa9, 0x78, 0x75, 0xff, 0xc5, 0xce, 0x51, 0x0, 0xf5, 0xb6, 0x8d, 0xce, 0xbb, 0x9b, 0xfe, 0xeb, 0x29, 0xc, 0x81, 0xf6, 0x1a}} 156 | return a, nil 157 | } 158 | 159 | var _sample = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\x74\x90\xc1\x6a\xeb\x30\x10\x45\xf7\xfe\x8a\x79\x0a\x64\xf5\x64\x3b\xa1\x2d\xe9\xb2\xb4\x50\xba\xe8\xaa\x5b\x43\x90\xa5\x49\x32\x44\x99\x11\x92\x9c\x94\x7e\x7d\x51\x4c\x1a\x17\x9a\xed\xd1\xb9\x57\x97\x99\xfd\x6b\x7a\xe2\xa6\x37\x69\x57\x55\x33\xf8\x20\xb6\x08\x36\xa2\xc9\xa8\xdd\x61\x0b\x4e\x30\x01\x4b\x06\x39\x62\x8c\xe4\xf0\x3f\xf4\x08\x69\x88\x08\x59\xc0\xa1\xc7\x8c\x10\x22\x1e\x49\x86\x04\x2f\xef\xaf\x55\xc6\x94\x41\x6f\xe0\x29\x04\x4f\xd6\x64\x12\xd6\x6f\x9c\xb2\xf1\x1e\x63\x5d\x3a\xe7\x73\x88\x87\xdb\xef\x65\xc7\xf3\x79\x01\xe4\x1d\x9e\x3b\xeb\x66\x32\xa9\xab\xb4\x3e\x8a\x67\x73\x40\x50\x93\x16\xf8\x69\x51\x17\x87\xac\x30\x28\x73\x75\xba\x75\x41\x35\x59\x4e\xa3\xd4\x1b\xbb\xdf\x46\x19\xd8\x81\xa2\x4b\xbe\x5b\x5f\x71\x1d\x78\x3b\xaa\x27\x62\x27\x27\x1d\x24\xc1\xb2\x6d\x61\xb1\x6c\xa7\x38\xd1\x17\xc2\xaa\x6d\xe1\xae\x1d\x79\xf9\x68\xa4\x8b\x09\xf9\xb5\xb8\x36\x21\xa8\xb1\xec\x71\x54\x76\xe4\x50\xe3\x67\x46\x4e\xf4\xa7\x5c\x24\x13\x82\x76\x51\x82\xf6\xc4\x7b\x78\x28\xf1\xd5\x3d\x74\x95\xba\x79\xd2\x92\x53\x49\x86\x68\x71\xbd\x11\xef\x30\x36\xea\x3b\x00\x00\xff\xff\x9a\x7a\xc8\xda\xfa\x01\x00\x00") 160 | 161 | func sampleBytes() ([]byte, error) { 162 | return bindataRead( 163 | _sample, 164 | "sample", 165 | ) 166 | } 167 | 168 | func sample() (*asset, error) { 169 | bytes, err := sampleBytes() 170 | if err != nil { 171 | return nil, err 172 | } 173 | 174 | info := bindataFileInfo{name: "sample", size: 506, mode: os.FileMode(0755), modTime: time.Unix(1572713988, 0)} 175 | a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x91, 0x1c, 0xb9, 0x55, 0x14, 0xb0, 0xf9, 0x4, 0x58, 0xe0, 0x6e, 0x5f, 0x8, 0x9e, 0xf7, 0x7c, 0xb6, 0xff, 0xb3, 0x84, 0x4f, 0xce, 0xe, 0x94, 0xbc, 0x12, 0x67, 0x8f, 0x6f, 0x8d, 0x3, 0x46}} 176 | return a, nil 177 | } 178 | 179 | var _supportBrewMeSh = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\x9c\x91\x4f\x6f\xaa\x40\x14\xc5\xf7\xf7\x53\xdc\x37\xf2\x32\xfa\x7c\x80\xac\x1b\x4d\xd4\x92\x94\x84\x50\x82\x26\xdd\x34\x21\x23\x4c\x94\x74\xc0\x09\x33\x56\x1b\xeb\x77\x6f\x44\x51\xfc\xd3\x2e\xba\xbc\x87\x73\x38\xf7\x77\xa7\xf5\xc7\x9e\x65\x85\x3d\x63\x6a\x01\xd0\xc2\xd1\xaa\x48\x05\x47\xb5\x92\x72\x59\x6a\x54\x49\x99\x49\xad\x50\x2f\x31\x67\x59\x71\x9c\x01\x92\x14\x89\xb1\xed\xfd\xb5\xff\xed\x08\xc0\x41\xed\x53\xcb\xb2\x93\x92\x33\xcd\xcd\x34\x9f\xd3\xa3\x1c\xcf\x4a\xbe\xbe\xfa\x66\xee\x35\x0a\x4c\x4a\xc1\xeb\xb0\xe6\xb9\x14\x4c\x73\xab\xa1\x52\x10\x59\xc2\x0b\x75\x32\xed\xb3\x47\xc9\x92\x1f\x14\x80\x29\xd1\x37\xda\x6c\xfd\x86\xc4\x1e\x45\xee\x4b\xec\x05\xbe\x17\xb8\xf1\x30\x0c\x7d\x77\x32\x8e\xbc\x70\x1a\x87\xfe\x70\xec\x3e\x3d\xfb\x8f\x6e\x64\x6f\x51\x96\x59\xa1\x31\x88\x1e\x90\x6f\x32\x8d\x3b\x82\xc4\x38\xfc\x9e\x74\x40\xf1\x14\xcd\x02\x9d\xff\x46\xbb\x8d\x4c\x09\x34\xd1\xc1\x4e\x47\x9e\x3d\xf8\x89\x95\x89\x23\x55\x75\xe3\x64\x3a\xf4\xfd\x7e\xef\x72\x74\xec\x39\xc5\xc1\x29\x58\x9d\x81\x40\xc2\x34\x12\xa3\x81\x48\x70\x70\x63\x12\xdf\x40\xf9\xde\xd8\x0d\x26\xee\x2f\x80\x6a\x9c\x6e\x85\x53\xd1\x89\xbb\x74\xb7\xcb\x1c\x36\xbe\x78\x87\xfa\x08\xd4\x49\xe9\x9d\x44\xa3\x53\x9c\x3b\x5f\x8d\x9f\x7b\x20\x7f\xbf\x92\xce\x76\x48\x16\xf9\x32\xc5\xee\xa6\x21\x7d\x05\x00\x00\xff\xff\x95\x85\xa5\x4e\xb9\x02\x00\x00") 180 | 181 | func supportBrewMeShBytes() ([]byte, error) { 182 | return bindataRead( 183 | _supportBrewMeSh, 184 | "support/brew-me.sh", 185 | ) 186 | } 187 | 188 | func supportBrewMeSh() (*asset, error) { 189 | bytes, err := supportBrewMeShBytes() 190 | if err != nil { 191 | return nil, err 192 | } 193 | 194 | info := bindataFileInfo{name: "support/brew-me.sh", size: 697, mode: os.FileMode(0755), modTime: time.Unix(1572713988, 0)} 195 | a := &asset{bytes: bytes, info: info, digest: [32]uint8{0xa8, 0x66, 0x9f, 0xa6, 0xd9, 0xf6, 0xad, 0xa7, 0xaf, 0xb5, 0xe9, 0x58, 0x4b, 0xa1, 0xce, 0x88, 0xf1, 0xab, 0x98, 0x6f, 0x23, 0x68, 0xac, 0x34, 0x44, 0x18, 0x9b, 0x71, 0x7e, 0x94, 0xb3, 0xe5}} 196 | return a, nil 197 | } 198 | 199 | var _supportDmgLicensePy = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xa4\x58\x7f\x73\xa2\xc8\xd6\xfe\x9f\x4f\x71\x96\x7d\x53\x68\x8d\x21\x88\x08\xc9\xbe\xeb\x56\x11\xc5\x09\xef\x9b\x68\x4a\xc9\xce\xce\x8e\x53\x16\x42\xa3\x7d\x07\x69\x96\x6e\x27\x63\x6e\xdd\xef\x7e\xeb\x34\x68\x40\x33\x73\xb7\xea\xfa\x87\x4a\x77\x9f\x73\x9e\xe7\x9c\xa7\x7f\xd0\x3f\xff\x74\xb5\xe3\xc5\xd5\x8a\x66\x57\x24\xfb\x0a\xf9\x5e\x6c\x58\xa6\xa8\xaa\xaa\x04\x1b\xca\x81\x47\x05\xcd\x05\x84\x71\xcc\x21\x84\x94\x46\x24\xe3\x04\x12\x9a\x12\x10\x0c\x42\x18\x3d\xbc\xd7\x61\x46\xfe\xda\xd1\x82\x70\xf8\x23\x62\x31\x81\x30\x8b\x21\x84\x3c\x0d\x69\x06\x21\x8f\x28\x05\x41\xbe\x09\xa5\x6e\xac\x2b\xd3\xd5\x57\xca\x76\x3c\xdd\x03\xcb\xd2\x3d\x14\xbb\x8c\x03\xcb\x20\x84\x87\x30\xd2\x15\x65\xc8\xf2\x7d\x41\xd7\x1b\x01\xad\x61\x1b\x4c\xa3\xdb\xbd\x34\x8d\x6e\x0f\xfe\x2f\x2c\x48\x0c\x77\x6c\xb5\xe2\x8a\xf2\x48\x8a\x2d\xe5\x9c\xb2\x0c\x28\x87\x0d\x29\xc8\x6a\x0f\xeb\x22\xcc\x04\x89\x3b\x90\x14\x84\x00\x4b\x20\xda\x84\xc5\x9a\x74\x24\xde\x6c\x0f\x39\x29\x38\xcb\x80\xad\x44\x48\x33\x9a\xad\x21\x84\x88\xe5\x7b\x85\x25\x20\x24\x63\x96\x88\xe7\xb0\xa8\x68\x70\xce\x22\x1a\x0a\x12\x43\xcc\xa2\xdd\x96\x64\x22\x14\x18\x0f\x49\x70\x68\x89\x0d\x01\x75\x5e\x59\xa8\x6d\x19\x24\x26\x61\xaa\xd0\x0c\xb0\xef\xd0\x05\xcf\x54\x6c\xd8\x4e\x40\x41\xb8\x28\x68\x84\x3e\x3a\x40\xb3\x28\xdd\xc5\x88\xe1\xd0\x9d\xd2\x2d\xad\x22\xa0\xb9\xcc\x00\x57\x04\x83\x1d\x27\x1d\x89\xb3\x03\x5b\x16\xd3\x04\x7f\x89\xa4\x95\xef\x56\x29\xe5\x9b\x0e\xc4\x14\x5d\xaf\x76\x82\x74\x80\x63\xa3\x4c\x77\x07\x79\x5c\xb1\x02\x38\x49\x53\x25\x62\x39\x25\x1c\x24\xd7\x57\x74\x72\x0c\x42\xcf\x31\xa1\xa2\x4a\x11\xc7\x96\xe7\x0d\xdb\x36\x99\x50\xae\x24\xbb\x22\xa3\x7c\x43\xa4\x4d\xcc\x80\x33\x19\xf1\x1f\x24\x12\xd8\x82\xc3\x13\x96\xa6\xec\x19\xa9\x45\x2c\x8b\x29\x32\xe2\xbf\x28\x4a\xb0\x21\x10\xae\xd8\x57\x22\xb9\x94\x05\xce\x98\xa0\x51\x99\x6e\x59\x80\xfc\xb5\xaa\x55\x17\xdf\x84\x69\x0a\x2b\x52\x25\x8c\xc4\x40\x33\x05\x9b\x0e\x74\x0a\x0c\xcf\x45\x98\x09\x1a\xa6\x90\xb3\x42\xc6\x3b\xa5\xa9\x2b\x4a\x70\xe7\xc1\x7c\x3a\x0e\x3e\xb8\x33\x0f\xfc\x39\x3c\xce\xa6\xbf\xfb\x23\x6f\x04\xaa\x3b\x07\x7f\xae\x76\xe0\x83\x1f\xdc\x4d\x9f\x02\xf8\xe0\xce\x66\xee\x24\xf8\x08\xd3\x31\xb8\x93\x8f\xf0\xff\xfe\x64\xd4\x01\xef\x8f\xc7\x99\x37\x9f\xc3\x74\xa6\xf8\x0f\x8f\xf7\xbe\x37\xea\x80\x3f\x19\xde\x3f\x8d\xfc\xc9\x7b\xb8\x7d\x0a\x60\x32\x0d\xe0\xde\x7f\xf0\x03\x6f\x04\xc1\x14\x30\x60\xe5\xca\xf7\xe6\xe8\xec\xc1\x9b\x0d\xef\xdc\x49\xe0\xde\xfa\xf7\x7e\xf0\xb1\xa3\x8c\xfd\x60\x82\x3e\xc7\xd3\x19\xb8\xf0\xe8\xce\x02\x7f\xf8\x74\xef\xce\xe0\xf1\x69\xf6\x38\x9d\x7b\xe0\x4e\x46\x30\x99\x4e\xfc\xc9\x78\xe6\x4f\xde\x7b\x0f\xde\x24\xd0\xc1\x9f\xc0\x64\x0a\xde\xef\xde\x24\x80\xf9\x9d\x7b\x7f\x8f\xa1\x14\xf7\x29\xb8\x9b\xce\x10\x1f\x0c\xa7\x8f\x1f\x67\xfe\xfb\xbb\x00\xee\xa6\xf7\x23\x6f\x36\x87\x5b\x0f\xee\x7d\xf7\xf6\xde\x2b\x43\x4d\x3e\xc2\xf0\xde\xf5\x1f\x3a\x30\x72\x1f\xdc\xf7\x9e\xb4\x9a\x06\x77\xde\x4c\xc1\x61\x25\x3a\xf8\x70\xe7\x61\x13\xc6\x73\x27\xe0\x0e\x03\x7f\x3a\x41\x1a\xc3\xe9\x24\x98\xb9\xc3\xa0\x03\xc1\x74\x16\x1c\x4d\x3f\xf8\x73\xaf\x03\xee\xcc\x9f\x63\x42\xc6\xb3\xe9\x43\x47\xc1\x74\x4e\xc7\x38\xc4\x9f\xa0\xdd\xc4\x2b\xbd\x60\xaa\xa1\x51\x91\xe9\x4c\x3e\x3f\xcd\xbd\xa3\x43\x18\x79\xee\xbd\x3f\x79\x3f\x07\x7f\xd2\x28\x9f\x2e\x17\xa9\xa4\x60\x5b\x58\x2e\x93\x9d\xd8\x15\x64\xb9\x04\xba\xc5\xea\x43\x5e\xd0\x4c\x2c\x93\x5d\x26\x67\x9a\x52\xb5\x32\x7e\xf8\xc7\xf7\xc7\xbf\x82\x6c\x73\x9c\xcd\xc7\x41\xb9\xc8\xc3\x82\x13\x45\x51\xa2\x34\xe4\x1c\x1e\x43\xb1\x69\x71\x51\xb4\x7f\x51\x00\x00\x62\x92\xc0\x72\x49\x32\x41\x8a\xe5\xb2\xc5\x49\x9a\x54\x1d\xf8\x29\x88\xd8\x15\x19\xce\xb5\x44\xa9\x8f\xfe\x46\x45\x35\xb8\x03\x62\x9f\x93\x0e\x7c\x0d\xd3\x1d\x2e\x4a\x45\x18\x91\x55\x18\x7d\xa9\x39\x61\x5c\xdf\x65\x29\xcd\xbe\x94\xde\x15\x45\x41\x2f\xdb\x2f\x88\xb4\x15\xd3\x62\x30\x61\x99\x9c\xe3\x49\x42\xbf\x0d\x34\xad\x32\x6d\x25\xb8\xe8\xd1\x94\x64\xe1\x96\xb4\x61\x70\x64\xa6\x6f\xbf\xf0\xa3\x6d\x4c\x8b\xa3\x69\xf9\xd3\x56\xaa\xa0\x51\xca\x38\x69\x25\x71\xd9\x50\x51\x91\xec\x8f\x5e\x0f\x58\x42\x9a\xb5\x58\x2e\x67\x59\x07\xc2\x62\xcd\x0f\xc9\xd9\xae\xc7\x34\x25\x9d\xe3\x4e\x31\x90\xbd\xb2\x0f\xd7\xb8\x03\x0b\x4d\xd7\xda\x10\x72\x10\xdb\x1c\xc7\xbf\x72\x97\x83\x58\x4e\xb2\x56\xd5\xd5\x01\xed\xb9\x1c\x9b\xbc\x8e\xc2\x4f\xa2\x3f\x17\x54\x90\x96\xaa\xaa\x71\x28\x42\xd0\x82\x87\xc7\x7b\x0d\x5a\x5d\xf3\xba\x03\xea\xfd\x23\x8d\xd4\x36\xfc\xf3\x68\xf2\x3f\x6a\xb7\x67\x59\x60\xf7\x6d\x1b\xec\xae\xd3\x07\x7b\xe8\x58\x60\x1a\xd6\x10\xec\xae\xed\x81\xed\x60\x5b\xd7\x76\xd4\x9a\x89\xdd\x37\x0d\xb0\x6e\x2c\x0b\x2c\xab\xef\x40\xdf\xb4\x2c\x30\xfa\x56\x0f\xec\x31\x8e\xf6\x1c\x0b\xac\xb1\xd5\xab\x9b\x58\x5e\xdf\x02\xc3\x32\x5d\x30\x5d\xf9\x65\x0d\xa1\xdf\xeb\x5b\x60\xf5\x8c\x5b\x70\x7a\xce\x0d\x38\x3d\xd3\x68\x44\x19\xda\x5d\xb0\x3d\xdb\x41\x38\x37\x60\x59\x96\x05\x7d\xa7\x6f\x82\x65\x75\x3d\xb0\x87\xf6\x18\xec\x9e\xdd\x6d\x9a\x98\x06\x38\xa6\xdd\x97\xce\x4a\x88\xa6\x61\x5e\x83\x3d\x46\x7e\xb6\xd3\x03\xbb\xef\x58\x75\x13\xd3\xb0\x6d\x34\x19\x83\x3d\x32\x0d\xe8\xf5\x7b\x06\xf4\x8c\x9e\x51\xa3\xd6\x35\x7a\x66\xc3\x64\x64\x9b\xe0\xdc\x38\x98\x36\xd3\x80\x57\x9c\x4e\x1f\xff\x39\x76\x1f\x7a\x63\xab\x11\xa5\xc2\x6d\x58\x07\xfa\xa6\x0b\xd6\xb0\xdf\x83\xbe\x65\xf5\x55\xe5\x5f\xff\xab\x28\x65\xb5\xb0\x40\x1a\xb4\xfa\x86\x61\x34\xcb\x64\x18\x86\x01\x86\x61\x98\x70\xf8\x77\xf2\x65\xc9\x7f\x75\x5f\xf3\x60\xf6\x73\xe5\xab\x03\xaa\x97\xad\x71\x43\x84\xd5\x4e\x08\x96\x71\xf5\xcc\xbd\x0d\xc6\xc8\xea\x97\x4c\xec\xa1\x8d\x05\xb1\xaf\xc1\x34\x24\x4f\xa7\x07\x8e\xd5\x6b\x24\xdb\xe8\x5b\xc8\xd6\x31\x51\x3d\x7d\x30\xae\x51\x47\x37\x98\xe2\x2e\xe6\x02\xab\x60\xf7\x8d\x7e\x23\x0d\x06\x8e\xbe\xb1\x3d\x70\x2c\xc3\x81\x7e\xcf\xee\x82\x63\xdb\x7d\x30\x3d\xd3\x03\xd3\x73\x5c\xb0\x6e\x6c\xbb\x59\x1f\xe7\xa6\xd4\x95\x69\xd8\xf5\x78\xa6\xe1\x38\x18\xcf\x02\xfb\xba\x29\x1c\xc7\xb2\xaf\xcb\xd2\x38\x16\x4a\xc1\xb4\x47\xa5\x1e\xa4\x0a\x4a\x42\xd7\xf6\x4d\xc3\xa4\x57\x16\xf2\x06\x25\x25\x25\x8c\x4a\x31\x87\x18\xb4\x77\xec\xb8\x6d\x02\x33\x4d\xb0\x6a\x54\x4d\xb3\xf2\x3d\x46\x5f\x5d\xb4\xeb\xd9\xfd\x66\x14\xa7\x77\x8c\x2f\x19\xf4\x4a\x4c\x8e\x85\x5c\xba\x92\x9a\xe9\x9d\x44\x31\x64\x4e\xa0\x91\x88\x43\x14\xcf\x1e\x83\x63\x9d\xcc\x9b\x3a\x26\x64\xe0\x1c\xe7\x84\x0c\x8f\xb0\xad\x53\xfa\xcd\xd4\x7a\xa6\xf9\xb6\x90\xcc\x57\x21\xbd\x29\x20\xe7\x5c\x40\x4d\x99\x34\x04\xf4\x1d\xc5\x40\x53\x26\x0d\x01\x9d\x29\xe6\xf6\x8d\xec\x34\xd7\x84\xef\x28\x06\x9a\x32\x69\xa4\xe3\x3b\x8a\x81\xa6\x4c\x1a\x51\x6a\x8a\x79\x23\xdf\x07\x7e\x27\xab\x68\x43\x31\x92\x6f\x0f\x1f\xbb\xf6\x10\xca\xa5\xcc\xb2\xaf\xcf\x16\x5e\xa7\x87\x8b\x95\xed\x58\xe0\x38\x98\x0d\xb3\xcc\x86\x51\x2e\x93\xb6\x7d\x32\x19\x6e\x50\x22\x72\x9d\xb2\xec\x31\x66\xc7\xc3\x3c\x59\x27\xd3\xa9\xa1\x39\x19\x5a\xd6\x40\xce\x7b\x24\x6d\x9a\x67\xb5\x3a\xe7\xe2\xa1\x68\x16\xd9\x22\x53\x55\xb5\xdd\xd8\x95\x5e\xf7\xaf\xe3\xf9\x5b\x2b\xca\xfd\x2b\x6d\xee\x5f\xf8\xf9\x42\xb3\x18\x06\xa0\xcd\x82\x31\x68\x40\x93\xc3\xb6\xa9\xa7\xec\x99\x14\xad\xb6\x4e\xb2\x98\xa3\xcb\x96\xa6\x17\x22\xd1\xda\x40\x52\x4e\x40\x0b\xbc\x3f\x02\xed\xcc\xdb\x61\x47\xd4\xa4\x98\x17\xda\x05\x5f\x9c\xad\x8a\x28\xe6\x45\xa6\xc1\x85\x8c\xdd\x3e\xf3\x81\xbb\x3b\xe1\x51\x98\x93\x16\x6f\x9f\x03\x86\xda\x19\x47\xc7\xd7\x8d\xbc\xd5\xd6\x0b\x92\xa7\x61\x44\x5a\xda\x62\xa1\x75\x40\x5b\x2c\x16\x0b\xad\xd6\xaa\x96\x8d\x6a\xbd\x6d\x61\x60\xa3\xd6\x56\xce\x49\xb0\x02\x52\x9a\xe1\x59\xff\xad\x8c\xe1\x47\x76\x0f\x0e\x30\xf1\xe9\x9c\x47\xdd\x55\x81\xbe\x3e\xe1\xbf\x4f\xf4\x17\xfa\xae\x6b\x18\xc6\x67\xd9\x49\xb1\xa3\x08\xb3\x35\x69\x19\x1d\x48\x65\xd1\x32\xd2\xee\x00\x0e\x69\x7f\x7e\x3b\x7a\x23\xd3\xf8\xa0\x6a\xf0\xae\x8a\xf3\x0e\x34\x75\x91\x69\xdf\x81\x73\x66\xa4\x2d\x16\xd9\xdb\xe3\x8f\x63\x4b\x99\x9d\x8c\x38\x3b\xfa\x70\xb1\x4f\xdf\x2c\x75\x73\xdd\xea\x35\x37\xd2\x21\x7e\xdd\x80\x61\x74\xad\xd7\x0e\xf5\x8d\xad\xb8\xf9\x65\x3a\x27\xc6\x0d\x93\xee\x9b\x7b\xf6\xab\xb1\x2b\x8d\x4f\xa2\x9c\x82\x38\xf9\x2a\x67\x5b\x63\xae\x31\xae\xf3\x3d\x9e\x6a\x5b\xda\x26\xa6\x3b\x41\x53\xd8\x65\x49\x1a\x0a\x41\x32\xb8\xfc\x6b\x47\x89\x00\xf5\x82\xab\xa8\xf4\xea\x50\xda\xae\x9f\xd2\x61\x50\x77\x71\xc1\xe1\x32\x04\xfc\x66\x07\xab\xef\xd6\xfe\x70\xee\xd5\x0b\xf2\xd2\x81\xe3\x29\xf5\x10\xe4\x87\x10\xff\x2e\x40\x9a\xc0\x21\x4a\xc4\xb6\x79\x41\x8e\x97\x1c\x19\x13\x80\xc7\xff\xa6\x36\x6b\xa1\xa2\x1c\x79\x5c\x70\x1d\xcf\xd9\x7a\xbc\x5d\x63\x80\xd6\xf1\x5c\x7e\x0e\xb3\xb2\x2f\xc8\x96\x7d\x25\xad\x33\x28\x3f\x80\x33\x18\x80\xba\x7a\x31\xd5\xf3\x79\xf2\x06\xf5\x88\x65\x5f\x49\x21\xea\xc8\xe0\x32\x61\xc5\x36\x14\xf0\x34\xba\xfd\x13\x53\x7f\xc1\x7f\x94\x78\xf8\x8f\x34\x48\xfa\x03\xa4\xeb\x97\xff\x1e\x68\xad\x58\xf0\xee\x07\x40\xb5\xa7\xd1\x9f\x53\xb8\xa4\xdb\x70\x4d\xbe\x90\x3d\xbc\xa4\x74\x75\x19\x93\xaf\x24\x1d\xdc\x1c\x89\x9e\x97\xbd\x59\x0a\xed\xa4\x88\x8d\xe1\x34\x29\x55\x3c\x00\xe3\x95\x95\x7c\xeb\x6d\xa9\xf3\x5d\x14\x11\xce\x93\x5d\x9a\xee\x21\x8c\x63\x12\x1f\x5f\xc7\x04\x03\xed\x82\x6b\xea\xa9\x3b\xdc\x56\xce\xfc\x8c\x43\x9a\x96\x77\x3c\x61\xfc\x63\x17\x0a\xc5\xb7\x5c\x7c\x43\x5c\x2e\x11\x93\xb6\x5c\xe2\x2b\xe2\x72\xa9\x95\x4e\xe5\x0b\x75\x81\x73\xae\x7a\xb9\xd6\xa7\xb2\x4a\x8f\xb2\xbd\xd5\xae\x0d\xd2\x39\x11\xcb\x1d\x0f\xd7\x72\x79\xbb\xc8\x0b\xb6\x86\x5f\xab\x40\xbf\xc1\xaf\x15\x8a\xf2\xe9\xd3\xf4\x31\xf0\xa7\x93\xf9\x67\x05\x40\xde\x56\xe2\xe8\x22\xdc\x1e\xae\x2b\x8f\x57\x79\x07\xec\xe1\xba\x20\x64\x4b\x32\x71\xbc\xbc\xac\x6e\x23\x01\x7c\x01\xc5\xf9\x35\x26\xa1\x62\x43\x8a\x37\x6e\x33\x9b\x48\x14\x00\x86\xa3\xea\x8d\xb8\x61\xff\x56\x9e\x07\xc4\x86\x00\x6e\xf1\x11\xcb\x04\xc9\x04\xd7\x71\xdb\x9b\x13\x02\x97\x97\x1b\x92\xe6\x72\x2f\xda\xb2\x82\x40\x4c\x44\x48\x53\xae\x1f\x97\xba\x2a\x27\x61\x1c\x2f\x4b\x5d\xb7\x8e\x45\xd2\x2e\x2f\x0b\xf2\xa2\x75\x6a\x0d\x45\xed\x29\x94\x37\x1f\x03\x8d\x0b\x56\x90\x5a\x7b\x4c\x92\x70\x97\x8a\x81\x76\xe5\xe6\x79\x4a\x23\x79\xd9\xc8\xaf\x24\x65\x3d\xcc\xf3\xab\x61\x05\xf2\x6a\x84\x7a\x65\x39\x29\xae\x02\xc6\x52\x7e\x35\x6b\x44\x43\xe0\x03\x2d\xd8\x10\xc8\x43\xa4\x58\x5e\xfb\xcd\xc8\x0b\x08\xc6\x52\x1d\x46\x65\x1c\x79\x89\x78\x51\x05\x2d\x8f\x2c\x7f\x87\x59\x6d\xf2\x36\x18\x46\x7f\x83\x61\xb4\x61\x34\x22\x7c\xf0\x49\x5b\xbd\x98\x78\xcc\x58\xbf\x68\x9f\xcf\x13\x20\x2f\x51\x4e\xe8\x94\xaa\x0c\x71\xde\x1c\x10\xa0\xc8\x61\xc7\x69\xb6\x06\x9e\x93\x88\x26\x94\xc4\x50\x5f\x5b\xc4\x3e\x27\x3a\x9c\x9c\xc6\xb4\x61\x09\x02\x50\x7d\xab\x17\x53\x8a\x69\xfd\xa2\xd7\x33\xd0\xb8\x3f\x81\xc1\x21\x23\xf2\x67\x89\x6d\xd5\xbc\x88\x98\x3c\x24\xe2\xf1\x44\xde\xb4\xc0\x4f\x03\x30\x0f\x8b\x00\xee\x07\x8c\xeb\x58\x03\x9d\x7c\xa3\x5c\xf0\xfa\xfe\xd4\x3e\x9d\xd3\xda\xeb\x9c\x4e\xf0\xec\x89\xf5\x0a\xcb\x8d\xe8\xa7\xf2\x58\x58\xb7\x7e\x4d\x69\x09\x21\x28\x76\xe4\x10\x18\x9b\x6a\xde\x2b\xec\xf2\xda\xad\x9c\xbd\xaf\xd6\x7c\xcf\x11\x9b\x68\x75\xcb\xb6\x37\x6e\x8f\x94\x7f\x07\x00\x00\xff\xff\x3b\x35\x17\x24\x87\x18\x00\x00") 200 | 201 | func supportDmgLicensePyBytes() ([]byte, error) { 202 | return bindataRead( 203 | _supportDmgLicensePy, 204 | "support/dmg-license.py", 205 | ) 206 | } 207 | 208 | func supportDmgLicensePy() (*asset, error) { 209 | bytes, err := supportDmgLicensePyBytes() 210 | if err != nil { 211 | return nil, err 212 | } 213 | 214 | info := bindataFileInfo{name: "support/dmg-license.py", size: 6279, mode: os.FileMode(0755), modTime: time.Unix(1572713988, 0)} 215 | a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x92, 0x57, 0x1, 0x75, 0x33, 0x67, 0x1c, 0x68, 0xcd, 0x94, 0xb9, 0xc3, 0x14, 0x1, 0x14, 0x28, 0xc6, 0x85, 0x6c, 0xa6, 0x69, 0x32, 0x4d, 0x38, 0x46, 0x50, 0x79, 0x1, 0x1c, 0xe0, 0x9d, 0x4}} 216 | return a, nil 217 | } 218 | 219 | var _supportTemplateApplescript = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xc4\x54\x5b\x6f\xda\x4c\x10\x7d\x36\xbf\x62\x64\x7d\x8a\x82\x12\x72\xd1\xf7\x58\x55\x15\x01\x12\xac\x52\x20\x40\x1a\x68\x53\xa1\xc5\x1e\xcc\x34\x66\x17\xed\xae\xa1\x17\xe5\xbf\x57\xb3\xc0\x62\x48\x5a\xe5\xa5\xea\x83\x25\xef\x9c\xb9\x9c\x39\xb3\x3b\x4a\x82\xce\x25\x1c\x2f\x55\x96\xcf\xb1\x2d\xe6\x58\x2e\x05\x16\xb3\x0c\xc4\x62\x91\x51\x2c\x2c\x29\x09\xe1\x35\xc9\x04\x75\x58\x0a\xd6\x58\x42\xe6\xb1\x18\x03\xc2\x80\xb1\x9a\x64\x5a\x2e\x05\x41\xa0\x16\x28\x4b\xfc\x63\xd0\x82\x9d\xe1\xb0\xa3\x29\x25\x09\x56\xc1\x7d\xd4\x1e\x16\x90\xd1\x1e\x32\x2a\x20\xf7\x94\xd8\xd9\xc6\x7e\x5f\xb0\x37\x91\xd2\x99\xdd\x00\xcd\x62\x95\x2b\x65\xad\x9a\xf7\x18\x1e\x32\x7e\x5c\xa8\x7c\xe2\x53\x96\x5f\x8e\x18\x6d\x23\x46\xc5\x88\x75\x31\x1f\x92\x98\xbe\x55\x1a\xd9\x35\x7c\x08\x43\x38\x82\xf0\xfc\xa3\x13\xc1\x9c\xf3\xa9\x20\x08\x43\xce\xe1\xac\xde\x1f\xf7\x07\x9d\x5e\xe3\x21\x0c\x1d\x5b\x27\x60\xac\xa4\x15\x24\x51\xc3\x8a\x64\xa2\x56\x0c\xb8\x12\x71\xae\x35\x4a\x0b\x4b\xc2\x15\xd7\xa1\x58\x49\x77\xf0\x1e\x56\xa9\x6c\x22\x34\x2c\xc9\xd0\x24\x73\x64\xa6\x22\x33\xe8\x1d\x8c\x15\x36\x37\x7f\x74\xb1\x33\x84\x89\xca\x65\x62\x18\xfb\xb9\x13\xea\xb4\x30\x94\xd3\x43\x51\x0f\x0d\xa3\xa7\xd7\xd6\xec\x35\xba\x9d\x7e\x34\x88\x3a\xed\x71\x33\xaa\xd7\x1b\xed\xf1\x75\xd4\x6a\xf4\xc7\xb5\x56\xf5\xae\xdf\x60\x17\x94\x09\xb0\x32\x7e\xa0\x6a\x61\x1d\x39\xa6\xea\x45\x60\x2b\x29\x69\x40\x4d\x5f\x94\xd0\x69\xcb\x91\x9e\x98\x0b\x35\xf4\xc3\x11\x8a\x6a\x9d\xf6\xb8\x1f\x7d\x6a\xec\x84\xc0\x6f\xd6\xc3\x83\xc6\x70\xb0\x0f\x0b\xad\x85\x4c\x71\xce\x13\xb1\x0a\xa4\xf2\xa6\x64\x8f\x74\x10\x04\x57\xd5\xda\xfb\x9b\x5e\xe7\xae\x5d\xdf\x76\xc5\xd6\x4a\x05\xba\xca\x10\x93\x26\x99\xb2\xc5\x0b\xb1\xef\xd5\xa4\x64\xe3\xd0\x8c\xea\x51\xfb\xe6\x00\xae\x16\x1e\xa3\x90\x09\xdc\xb6\xa0\x45\xf2\x11\x6a\x99\xc8\x0d\xba\x76\xab\xdd\x6e\x2b\xaa\x55\x8b\xb9\x83\x20\xb8\x6d\x15\x0e\x71\xa6\xd6\x03\x71\x0f\x74\x9d\xf9\x5a\xe9\x18\xc1\x88\x25\xc9\x94\x65\x65\xbd\x59\x10\x86\x13\xcc\xc4\x77\xb8\x7c\xc5\xb5\xfd\x6b\x77\x0e\x2a\x70\x79\xf1\xec\xe2\x39\xeb\xd3\xc1\x08\x8a\x57\xa8\xc0\xfc\x35\x0b\xeb\x1f\x35\xf7\xf2\x83\xfa\x4d\x4b\x95\x4a\x4a\x4b\x74\x95\xa6\x6e\x1b\x83\x51\x73\x04\x4b\x73\xc7\x67\xa5\xc9\xae\x51\xb7\x71\xdc\x9e\x9a\x52\x86\x5e\x8c\xff\x39\x09\x73\x5d\x09\xb2\x83\x4d\xd4\xc5\xc6\x86\x5f\x31\xb6\x1f\xf6\x1a\xd3\xb8\x40\x61\x61\x35\xa3\x0c\x3d\x4e\x66\xd7\xf8\x56\xe3\xe0\x79\x5a\xff\x7f\xb2\xc6\xf9\xa3\x29\x1c\x27\x0a\xcc\x8c\xb5\x36\xb1\xa6\x85\x85\xf0\x33\x54\xa6\xc0\x7b\x72\xbb\x5a\x8f\x20\x84\x2f\x6f\x00\xe3\x99\x82\xff\xde\x85\x65\x78\x0b\xe1\x45\xc8\x7d\x49\x38\x20\x6a\x75\x8e\x1b\x8d\xd6\x5c\x4b\x41\x90\xa9\x14\x42\xae\x8e\x89\x4b\xeb\x89\x70\x5e\x83\xb1\xe2\x09\x4d\x95\x06\xbf\x96\x39\xd3\x04\x21\xd6\x28\x2c\x26\x67\x61\x69\x27\xba\xcb\x9c\xcb\xd2\xaf\x00\x00\x00\xff\xff\x0f\x5d\x68\x15\x24\x07\x00\x00") 220 | 221 | func supportTemplateApplescriptBytes() ([]byte, error) { 222 | return bindataRead( 223 | _supportTemplateApplescript, 224 | "support/template.applescript", 225 | ) 226 | } 227 | 228 | func supportTemplateApplescript() (*asset, error) { 229 | bytes, err := supportTemplateApplescriptBytes() 230 | if err != nil { 231 | return nil, err 232 | } 233 | 234 | info := bindataFileInfo{name: "support/template.applescript", size: 1828, mode: os.FileMode(0644), modTime: time.Unix(1572713988, 0)} 235 | a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x13, 0x72, 0x7c, 0x79, 0x30, 0xc5, 0xb, 0xe6, 0x39, 0xa1, 0xeb, 0x19, 0x1e, 0x89, 0x3f, 0x1e, 0xbc, 0x72, 0xc2, 0x70, 0x26, 0x8d, 0x46, 0x11, 0x39, 0x1b, 0x41, 0x41, 0xa, 0x3e, 0x86, 0x2a}} 236 | return a, nil 237 | } 238 | 239 | // Asset loads and returns the asset for the given name. 240 | // It returns an error if the asset could not be found or 241 | // could not be loaded. 242 | func Asset(name string) ([]byte, error) { 243 | canonicalName := strings.Replace(name, "\\", "/", -1) 244 | if f, ok := _bindata[canonicalName]; ok { 245 | a, err := f() 246 | if err != nil { 247 | return nil, fmt.Errorf("Asset %s can't read by error: %v", name, err) 248 | } 249 | return a.bytes, nil 250 | } 251 | return nil, fmt.Errorf("Asset %s not found", name) 252 | } 253 | 254 | // AssetString returns the asset contents as a string (instead of a []byte). 255 | func AssetString(name string) (string, error) { 256 | data, err := Asset(name) 257 | return string(data), err 258 | } 259 | 260 | // MustAsset is like Asset but panics when Asset would return an error. 261 | // It simplifies safe initialization of global variables. 262 | func MustAsset(name string) []byte { 263 | a, err := Asset(name) 264 | if err != nil { 265 | panic("asset: Asset(" + name + "): " + err.Error()) 266 | } 267 | 268 | return a 269 | } 270 | 271 | // MustAssetString is like AssetString but panics when Asset would return an 272 | // error. It simplifies safe initialization of global variables. 273 | func MustAssetString(name string) string { 274 | return string(MustAsset(name)) 275 | } 276 | 277 | // AssetInfo loads and returns the asset info for the given name. 278 | // It returns an error if the asset could not be found or 279 | // could not be loaded. 280 | func AssetInfo(name string) (os.FileInfo, error) { 281 | canonicalName := strings.Replace(name, "\\", "/", -1) 282 | if f, ok := _bindata[canonicalName]; ok { 283 | a, err := f() 284 | if err != nil { 285 | return nil, fmt.Errorf("AssetInfo %s can't read by error: %v", name, err) 286 | } 287 | return a.info, nil 288 | } 289 | return nil, fmt.Errorf("AssetInfo %s not found", name) 290 | } 291 | 292 | // AssetDigest returns the digest of the file with the given name. It returns an 293 | // error if the asset could not be found or the digest could not be loaded. 294 | func AssetDigest(name string) ([sha256.Size]byte, error) { 295 | canonicalName := strings.Replace(name, "\\", "/", -1) 296 | if f, ok := _bindata[canonicalName]; ok { 297 | a, err := f() 298 | if err != nil { 299 | return [sha256.Size]byte{}, fmt.Errorf("AssetDigest %s can't read by error: %v", name, err) 300 | } 301 | return a.digest, nil 302 | } 303 | return [sha256.Size]byte{}, fmt.Errorf("AssetDigest %s not found", name) 304 | } 305 | 306 | // Digests returns a map of all known files and their checksums. 307 | func Digests() (map[string][sha256.Size]byte, error) { 308 | mp := make(map[string][sha256.Size]byte, len(_bindata)) 309 | for name := range _bindata { 310 | a, err := _bindata[name]() 311 | if err != nil { 312 | return nil, err 313 | } 314 | mp[name] = a.digest 315 | } 316 | return mp, nil 317 | } 318 | 319 | // AssetNames returns the names of the assets. 320 | func AssetNames() []string { 321 | names := make([]string, 0, len(_bindata)) 322 | for name := range _bindata { 323 | names = append(names, name) 324 | } 325 | return names 326 | } 327 | 328 | // _bindata is a table, holding each asset generator, mapped to its name. 329 | var _bindata = map[string]func() (*asset, error){ 330 | "LICENSE": license, 331 | "README.md": readmeMd, 332 | "builder/create-dmg.builder": builderCreateDmgBuilder, 333 | "create-dmg": createDmg, 334 | "sample": sample, 335 | "support/brew-me.sh": supportBrewMeSh, 336 | "support/dmg-license.py": supportDmgLicensePy, 337 | "support/template.applescript": supportTemplateApplescript, 338 | } 339 | 340 | // AssetDir returns the file names below a certain 341 | // directory embedded in the file by go-bindata. 342 | // For example if you run go-bindata on data/... and data contains the 343 | // following hierarchy: 344 | // data/ 345 | // foo.txt 346 | // img/ 347 | // a.png 348 | // b.png 349 | // then AssetDir("data") would return []string{"foo.txt", "img"}, 350 | // AssetDir("data/img") would return []string{"a.png", "b.png"}, 351 | // AssetDir("foo.txt") and AssetDir("notexist") would return an error, and 352 | // AssetDir("") will return []string{"data"}. 353 | func AssetDir(name string) ([]string, error) { 354 | node := _bintree 355 | if len(name) != 0 { 356 | canonicalName := strings.Replace(name, "\\", "/", -1) 357 | pathList := strings.Split(canonicalName, "/") 358 | for _, p := range pathList { 359 | node = node.Children[p] 360 | if node == nil { 361 | return nil, fmt.Errorf("Asset %s not found", name) 362 | } 363 | } 364 | } 365 | if node.Func != nil { 366 | return nil, fmt.Errorf("Asset %s not found", name) 367 | } 368 | rv := make([]string, 0, len(node.Children)) 369 | for childName := range node.Children { 370 | rv = append(rv, childName) 371 | } 372 | return rv, nil 373 | } 374 | 375 | type bintree struct { 376 | Func func() (*asset, error) 377 | Children map[string]*bintree 378 | } 379 | 380 | var _bintree = &bintree{nil, map[string]*bintree{ 381 | "LICENSE": &bintree{license, map[string]*bintree{}}, 382 | "README.md": &bintree{readmeMd, map[string]*bintree{}}, 383 | "builder": &bintree{nil, map[string]*bintree{ 384 | "create-dmg.builder": &bintree{builderCreateDmgBuilder, map[string]*bintree{}}, 385 | }}, 386 | "create-dmg": &bintree{createDmg, map[string]*bintree{}}, 387 | "sample": &bintree{sample, map[string]*bintree{}}, 388 | "support": &bintree{nil, map[string]*bintree{ 389 | "brew-me.sh": &bintree{supportBrewMeSh, map[string]*bintree{}}, 390 | "dmg-license.py": &bintree{supportDmgLicensePy, map[string]*bintree{}}, 391 | "template.applescript": &bintree{supportTemplateApplescript, map[string]*bintree{}}, 392 | }}, 393 | }} 394 | 395 | // RestoreAsset restores an asset under the given directory. 396 | func RestoreAsset(dir, name string) error { 397 | data, err := Asset(name) 398 | if err != nil { 399 | return err 400 | } 401 | info, err := AssetInfo(name) 402 | if err != nil { 403 | return err 404 | } 405 | err = os.MkdirAll(_filePath(dir, filepath.Dir(name)), os.FileMode(0755)) 406 | if err != nil { 407 | return err 408 | } 409 | err = ioutil.WriteFile(_filePath(dir, name), data, info.Mode()) 410 | if err != nil { 411 | return err 412 | } 413 | return os.Chtimes(_filePath(dir, name), info.ModTime(), info.ModTime()) 414 | } 415 | 416 | // RestoreAssets restores an asset under the given directory recursively. 417 | func RestoreAssets(dir, name string) error { 418 | children, err := AssetDir(name) 419 | // File 420 | if err != nil { 421 | return RestoreAsset(dir, name) 422 | } 423 | // Dir 424 | for _, child := range children { 425 | err = RestoreAssets(dir, filepath.Join(name, child)) 426 | if err != nil { 427 | return err 428 | } 429 | } 430 | return nil 431 | } 432 | 433 | func _filePath(dir, name string) string { 434 | canonicalName := strings.Replace(name, "\\", "/", -1) 435 | return filepath.Join(append([]string{dir}, strings.Split(canonicalName, "/")...)...) 436 | } 437 | -------------------------------------------------------------------------------- /internal/createdmg/bindata/generate.go: -------------------------------------------------------------------------------- 1 | package bindata 2 | 3 | //go:generate bash -c "go-bindata -prefix '../../../vendor/create-dmg' -pkg bindata ../../../vendor/create-dmg/*" 4 | -------------------------------------------------------------------------------- /internal/createdmg/createdmg.go: -------------------------------------------------------------------------------- 1 | package createdmg 2 | 3 | import ( 4 | "context" 5 | "io/ioutil" 6 | "os" 7 | "os/exec" 8 | "path/filepath" 9 | 10 | "github.com/mitchellh/gon/internal/createdmg/bindata" 11 | ) 12 | 13 | // Cmd returns an *exec.Cmd that has the Path prepopulated to execute the 14 | // create-dmg script. You MUST call Close on this command when you're done. 15 | func Cmd(ctx context.Context) (*exec.Cmd, error) { 16 | // Create a temporary directory where we'll extract the project 17 | td, err := ioutil.TempDir("", "createdmg") 18 | if err != nil { 19 | return nil, err 20 | } 21 | 22 | // Extract the create-dmg project 23 | if err := bindata.RestoreAssets(td, ""); err != nil { 24 | os.RemoveAll(td) 25 | return nil, err 26 | } 27 | 28 | // Create a command 29 | return exec.CommandContext(ctx, filepath.Join(td, "create-dmg")), nil 30 | } 31 | 32 | // Close cleans up the temporary resources associated with the command. 33 | // This Cmd should've been returned by Cmd otherwise we may delete unrelated 34 | // data. 35 | func Close(cmd *exec.Cmd) error { 36 | // Protect against unset commands 37 | if cmd == nil || cmd.Path == "" || filepath.Base(cmd.Path) == cmd.Path { 38 | return nil 39 | } 40 | 41 | return os.RemoveAll(filepath.Dir(cmd.Path)) 42 | } 43 | -------------------------------------------------------------------------------- /internal/createdmg/createdmg_test.go: -------------------------------------------------------------------------------- 1 | package createdmg 2 | 3 | import ( 4 | "context" 5 | "path/filepath" 6 | "testing" 7 | 8 | "github.com/stretchr/testify/require" 9 | ) 10 | 11 | func TestCmd(t *testing.T) { 12 | require := require.New(t) 13 | 14 | cmd, err := Cmd(context.Background()) 15 | defer Close(cmd) 16 | require.NoError(err) 17 | require.FileExists(cmd.Path) 18 | require.FileExists(filepath.Join(cmd.Path, "..", "support", "dmg-license.py")) 19 | 20 | require.NoError(Close(cmd)) 21 | require.NoError(Close(cmd)) 22 | } 23 | -------------------------------------------------------------------------------- /notarize/error.go: -------------------------------------------------------------------------------- 1 | package notarize 2 | 3 | import ( 4 | "fmt" 5 | 6 | "github.com/hashicorp/go-multierror" 7 | ) 8 | 9 | // Error is the error structure generated by the notarization tool. 10 | type Error struct { 11 | Code int64 `plist:"code"` 12 | Message string `plist:"message"` 13 | UserInfo map[string]string `plist:"userInfo"` 14 | } 15 | 16 | // Errors is a list of error and also implements error. 17 | type Errors []Error 18 | 19 | // Error implements error 20 | func (err Error) Error() string { 21 | return fmt.Sprintf("%s (%d)", err.Message, err.Code) 22 | } 23 | 24 | // Error implements error 25 | func (err Errors) Error() string { 26 | if len(err) == 0 { 27 | return "no errors" 28 | } 29 | 30 | var result error 31 | for _, e := range err { 32 | result = multierror.Append(result, e) 33 | } 34 | 35 | return result.Error() 36 | } 37 | 38 | // ContainsCode returns true if the errors list has an error with the given code. 39 | func (err Errors) ContainsCode(code int64) bool { 40 | for _, e := range err { 41 | if e.Code == code { 42 | return true 43 | } 44 | } 45 | 46 | return false 47 | } 48 | -------------------------------------------------------------------------------- /notarize/info.go: -------------------------------------------------------------------------------- 1 | package notarize 2 | 3 | import ( 4 | "bytes" 5 | "context" 6 | "fmt" 7 | "io" 8 | "os/exec" 9 | "path/filepath" 10 | 11 | "github.com/hashicorp/go-hclog" 12 | "howett.net/plist" 13 | ) 14 | 15 | // Info is the information structure for the state of a notarization request. 16 | // 17 | // All fields should be checked against their zero value since certain values 18 | // only become available at different states of the notarization process. If 19 | // we were only able to submit a notarization request and not check the status 20 | // once, only RequestUUID will be set. 21 | type Info struct { 22 | // RequestUUID is the UUID provided by Apple after submitting the 23 | // notarization request. This can be used to look up notarization information 24 | // using the Apple tooling. 25 | RequestUUID string `plist:"id"` 26 | 27 | // Date is the date and time of submission 28 | Date string `plist:"createdDate"` 29 | 30 | // Name is th file uploaded for submission. 31 | Name string `plist:"name"` 32 | 33 | // Status the status of the notarization. 34 | Status string `plist:"status"` 35 | 36 | // StatusMessage is a human-friendly message associated with a status. 37 | StatusMessage string `plist:"message"` 38 | } 39 | 40 | // info requests the information about a notarization and returns 41 | // the updated information. 42 | func info(ctx context.Context, uuid string, opts *Options) (*Info, error) { 43 | logger := opts.Logger 44 | if logger == nil { 45 | logger = hclog.NewNullLogger() 46 | } 47 | 48 | // Build our command 49 | var cmd exec.Cmd 50 | if opts.BaseCmd != nil { 51 | cmd = *opts.BaseCmd 52 | } 53 | 54 | // We only set the path if it isn't set. This lets the options set the 55 | // path to the codesigning binary that we use. 56 | if cmd.Path == "" { 57 | path, err := exec.LookPath("xcrun") 58 | if err != nil { 59 | return nil, err 60 | } 61 | cmd.Path = path 62 | } 63 | 64 | cmd.Args = []string{ 65 | filepath.Base(cmd.Path), 66 | "notarytool", 67 | "info", 68 | uuid, 69 | "--apple-id", opts.DeveloperId, 70 | "--password", opts.Password, 71 | "--team-id", opts.Provider, 72 | "--output-format", "plist", 73 | } 74 | 75 | // We store all output in out for logging and in case there is an error 76 | var out, combined bytes.Buffer 77 | cmd.Stdout = io.MultiWriter(&out, &combined) 78 | cmd.Stderr = &combined 79 | 80 | // Log what we're going to execute 81 | logger.Info("requesting notarization info", 82 | "uuid", uuid, 83 | "command_path", cmd.Path, 84 | "command_args", cmd.Args, 85 | ) 86 | 87 | // Execute 88 | err := cmd.Run() 89 | 90 | // Log the result 91 | logger.Info("notarization info command finished", 92 | "output", out.String(), 93 | "err", err, 94 | ) 95 | 96 | // If we have any output, try to decode that since even in the case of 97 | // an error it will output some information. 98 | var result Info 99 | if out.Len() > 0 { 100 | if _, perr := plist.Unmarshal(out.Bytes(), &result); perr != nil { 101 | return nil, fmt.Errorf("failed to decode notarization submission output: %w", perr) 102 | } 103 | } 104 | 105 | // Now we check the error for actually running the process 106 | if err != nil { 107 | return nil, fmt.Errorf("error checking on notarization status:\n\n%s", combined.String()) 108 | } 109 | 110 | logger.Info("notarization info", "uuid", uuid, "info", result) 111 | return &result, nil 112 | } 113 | -------------------------------------------------------------------------------- /notarize/info_test.go: -------------------------------------------------------------------------------- 1 | package notarize 2 | 3 | import ( 4 | "context" 5 | "fmt" 6 | "strings" 7 | "testing" 8 | 9 | "github.com/hashicorp/go-hclog" 10 | "github.com/stretchr/testify/require" 11 | ) 12 | 13 | func init() { 14 | childCommands["info-accepted"] = testCmdInfoAcceptedSubmission 15 | childCommands["info-invalid"] = testCmdInfoInvalidSubmission 16 | } 17 | 18 | func TestInfo_accepted(t *testing.T) { 19 | info, err := info(context.Background(), "foo", &Options{ 20 | Logger: hclog.L(), 21 | BaseCmd: childCmd(t, "info-accepted"), 22 | }) 23 | 24 | require := require.New(t) 25 | require.NoError(err) 26 | require.Equal(info.RequestUUID, "32684f68-d63e-49ba-9234-25eeec84b369") 27 | require.Equal(info.Status, "Accepted") 28 | require.Equal(info.StatusMessage, "Successfully received submission info") 29 | } 30 | 31 | func TestInfo_invalid(t *testing.T) { 32 | info, err := info(context.Background(), "foo", &Options{ 33 | Logger: hclog.L(), 34 | BaseCmd: childCmd(t, "info-invalid"), 35 | }) 36 | 37 | require := require.New(t) 38 | require.NoError(err) 39 | require.Equal(info.RequestUUID, "cfd69166-8e2f-1397-8636-ec06f98e3597") 40 | require.Equal(info.Status, "Invalid") 41 | } 42 | 43 | // testCmdInfoAcceptedSubmission mimicks an accepted submission. 44 | func testCmdInfoAcceptedSubmission() int { 45 | fmt.Println(strings.TrimSpace(` 46 | 47 | 48 | 49 | 50 | createdDate 51 | 2023-08-01T08:22:19.939Z 52 | id 53 | 32684f68-d63e-49ba-9234-25eeec84b369 54 | message 55 | Successfully received submission info 56 | name 57 | binary.zip 58 | status 59 | Accepted 60 | 61 | 62 | `)) 63 | return 0 64 | } 65 | 66 | // testCmdInfoInvalidSubmission mimicks an invalid submission. 67 | func testCmdInfoInvalidSubmission() int { 68 | fmt.Println(strings.TrimSpace(` 69 | 70 | 71 | 72 | 73 | createdDate 74 | 2023-08-01T08:12:11.193Z 75 | id 76 | cfd69166-8e2f-1397-8636-ec06f98e3597 77 | message 78 | Successfully received submission info 79 | name 80 | binary.zip 81 | status 82 | Invalid 83 | 84 | 85 | `)) 86 | return 0 87 | } 88 | -------------------------------------------------------------------------------- /notarize/log.go: -------------------------------------------------------------------------------- 1 | package notarize 2 | 3 | import ( 4 | "bytes" 5 | "context" 6 | "encoding/json" 7 | "fmt" 8 | "io" 9 | "os/exec" 10 | "path/filepath" 11 | 12 | "github.com/hashicorp/go-hclog" 13 | ) 14 | 15 | // Log Retrieves notarization log for a single completed submission 16 | type Log struct { 17 | JobId string `json:"jobId"` 18 | Status string `json:"status"` 19 | StatusSummary string `json:"statusSummary"` 20 | StatusCode int `json:"statusCode"` 21 | ArchiveFilename string `json:"archiveFilename"` 22 | UploadDate string `json:"uploadDate"` 23 | SHA256 string `json:"sha256"` 24 | Issues []LogIssue `json:"issues"` 25 | TicketContents []LogTicketContent `json:"ticketContents"` 26 | } 27 | 28 | // LogIssue is a single issue that may have occurred during notarization. 29 | type LogIssue struct { 30 | Severity string `json:"severity"` 31 | Path string `json:"path"` 32 | Message string `json:"message"` 33 | } 34 | 35 | // LogTicketContent is an entry that was noted as being within the archive. 36 | type LogTicketContent struct { 37 | Path string `json:"path"` 38 | DigestAlgorithm string `json:"digestAlgorithm"` 39 | CDHash string `json:"cdhash"` 40 | Arch string `json:"arch"` 41 | } 42 | 43 | // log requests the information about a notarization and returns 44 | // the updated information. 45 | func log(ctx context.Context, uuid string, opts *Options) (*Log, error) { 46 | logger := opts.Logger 47 | if logger == nil { 48 | logger = hclog.NewNullLogger() 49 | } 50 | 51 | // Build our command 52 | var cmd exec.Cmd 53 | if opts.BaseCmd != nil { 54 | cmd = *opts.BaseCmd 55 | } 56 | 57 | // We only set the path if it isn't set. This lets the options set the 58 | // path to the codesigning binary that we use. 59 | if cmd.Path == "" { 60 | path, err := exec.LookPath("xcrun") 61 | if err != nil { 62 | return nil, err 63 | } 64 | cmd.Path = path 65 | } 66 | 67 | cmd.Args = []string{ 68 | filepath.Base(cmd.Path), 69 | "notarytool", 70 | "log", 71 | uuid, 72 | "--apple-id", opts.DeveloperId, 73 | "--password", opts.Password, 74 | "--team-id", opts.Provider, 75 | } 76 | 77 | // We store all output in out for logging and in case there is an error 78 | var out, combined bytes.Buffer 79 | cmd.Stdout = io.MultiWriter(&out, &combined) 80 | cmd.Stderr = &combined 81 | 82 | // Log what we're going to execute 83 | logger.Info("requesting notarization log", 84 | "uuid", uuid, 85 | "command_path", cmd.Path, 86 | "command_args", cmd.Args, 87 | ) 88 | 89 | // Execute 90 | err := cmd.Run() 91 | 92 | // Log the result 93 | logger.Info("notarization log command finished", 94 | "output", out.String(), 95 | "err", err, 96 | ) 97 | 98 | // If we have any output, try to decode that since even in the case of 99 | // an error it will output some information. 100 | var result Log 101 | // return &result, json.NewDecoder().Decode(&result) 102 | if out.Len() > 0 { 103 | if derr := json.Unmarshal(out.Bytes(), &result); derr != nil { 104 | return nil, fmt.Errorf("failed to decode notarization submission output: %w", derr) 105 | 106 | } 107 | } 108 | 109 | // Now we check the error for actually running the process 110 | if err != nil { 111 | return nil, fmt.Errorf("error checking on notarization status:\n\n%s", combined.String()) 112 | } 113 | 114 | logger.Info("notarization log", "uuid", uuid, "info", result) 115 | return &result, nil 116 | } 117 | -------------------------------------------------------------------------------- /notarize/log_test.go: -------------------------------------------------------------------------------- 1 | package notarize 2 | 3 | import ( 4 | "context" 5 | "fmt" 6 | "strings" 7 | "testing" 8 | 9 | "github.com/hashicorp/go-hclog" 10 | "github.com/stretchr/testify/require" 11 | ) 12 | 13 | func init() { 14 | childCommands["log-accepted"] = testCmdLogValidSubmission 15 | childCommands["log-invalid"] = testCmdLogInvalidSubmission 16 | } 17 | 18 | func TestLog_accepted(t *testing.T) { 19 | log, err := log(context.Background(), "foo", &Options{ 20 | Logger: hclog.L(), 21 | BaseCmd: childCmd(t, "log-accepted"), 22 | }) 23 | 24 | require := require.New(t) 25 | require.NoError(err) 26 | require.Equal(log.JobId, "3382aa04-e417-46a0-b1b4-42eebf85906c") 27 | require.Equal(log.Status, "Accepted") 28 | require.Equal(log.StatusSummary, "Ready for distribution") 29 | require.Equal(len(log.Issues), 0) 30 | require.Equal(len(log.TicketContents), 1) 31 | } 32 | 33 | func TestLog_invalid(t *testing.T) { 34 | log, err := log(context.Background(), "foo", &Options{ 35 | Logger: hclog.L(), 36 | BaseCmd: childCmd(t, "log-invalid"), 37 | }) 38 | 39 | require := require.New(t) 40 | require.NoError(err) 41 | require.Equal(log.JobId, "4ba7c420-7444-44bc-a190-1bd4bad97b13") 42 | require.Equal(log.Status, "Invalid") 43 | require.Equal(log.StatusSummary, "Archive contains critical validation errors") 44 | require.Equal(len(log.TicketContents), 0) 45 | require.Equal(len(log.Issues), 3) 46 | } 47 | 48 | // testCmdLogValidSubmission mimicks an accepted submission. 49 | func testCmdLogValidSubmission() int { 50 | fmt.Println(strings.TrimSpace(` 51 | { 52 | "logFormatVersion": 1, 53 | "jobId": "3382aa04-e417-46a0-b1b4-42eebf85906c", 54 | "status": "Accepted", 55 | "statusSummary": "Ready for distribution", 56 | "statusCode": 0, 57 | "archiveFilename": "gon.zip", 58 | "uploadDate": "2019-11-06T00:51:10Z", 59 | "sha256": "1070be725b5b0c89b8dad699a9080a3bf5809fe68bfe8f84d6ff4a282d661fd1", 60 | "ticketContents": [ 61 | { 62 | "path": "gon.zip/foo", 63 | "digestAlgorithm": "SHA-256", 64 | "cdhash": "b7049085e21423f102d6119bca93d57ebd903289", 65 | "arch": "x86_64" 66 | } 67 | ], 68 | "issues": null 69 | } 70 | `)) 71 | return 0 72 | } 73 | 74 | // testCmdLogInvalidSubmission mimicks an invalid submission. 75 | func testCmdLogInvalidSubmission() int { 76 | fmt.Println(strings.TrimSpace(` 77 | { 78 | "logFormatVersion": 1, 79 | "jobId": "4ba7c420-7444-44bc-a190-1bd4bad97b13", 80 | "status": "Invalid", 81 | "statusSummary": "Archive contains critical validation errors", 82 | "statusCode": 4000, 83 | "archiveFilename": "gon.zip", 84 | "uploadDate": "2019-11-06T00:54:22Z", 85 | "sha256": "c109f26d378fbf1efadc8987fdab79d2ce63155e8941823d4d11a907152e11a5", 86 | "ticketContents": null, 87 | "issues": [ 88 | { 89 | "severity": "error", 90 | "code": null, 91 | "path": "gon.zip/foo", 92 | "message": "The binary is not signed.", 93 | "docUrl": null, 94 | "architecture": "x86_64" 95 | }, 96 | { 97 | "severity": "error", 98 | "code": null, 99 | "path": "gon.zip/foo", 100 | "message": "The signature does not include a secure timestamp.", 101 | "docUrl": null, 102 | "architecture": "x86_64" 103 | }, 104 | { 105 | "severity": "error", 106 | "code": null, 107 | "path": "gon.zip/foo", 108 | "message": "The executable does not have the hardened runtime enabled.", 109 | "docUrl": null, 110 | "architecture": "x86_64" 111 | } 112 | ] 113 | } 114 | `)) 115 | return 0 116 | } 117 | -------------------------------------------------------------------------------- /notarize/notarize.go: -------------------------------------------------------------------------------- 1 | // Package notarize notarizes packages with Apple. 2 | package notarize 3 | 4 | import ( 5 | "context" 6 | "fmt" 7 | "os/exec" 8 | "sync" 9 | "time" 10 | 11 | "github.com/hashicorp/go-hclog" 12 | ) 13 | 14 | // Options are the options for notarization. 15 | type Options struct { 16 | // File is the file to notarize. This must be in zip, dmg, or pkg format. 17 | File string 18 | 19 | // DeveloperId is your Apple Developer Apple ID. 20 | DeveloperId string 21 | 22 | // Password is your Apple Connect password. This must be specified. 23 | // This also supports `@keychain:` and `@env:` formats to 24 | // read from the keychain and environment variables, respectively. 25 | Password string 26 | 27 | // Provider is the Apple Connect provider to use. This is optional 28 | // and is only used for Apple Connect accounts that support multiple 29 | // providers. 30 | Provider string 31 | 32 | // UploadLock, if specified, will limit concurrency when uploading 33 | // packages. The notary submission process does not allow concurrent 34 | // uploads of packages with the same bundle ID, it appears. If you set 35 | // this lock, we'll hold the lock while we upload. 36 | UploadLock *sync.Mutex 37 | 38 | // Status, if non-nil, will be invoked with status updates throughout 39 | // the notarization process. 40 | Status Status 41 | 42 | // Logger is the logger to use. If this is nil then no logging will be done. 43 | Logger hclog.Logger 44 | 45 | // BaseCmd is the base command for executing app submission. This is 46 | // used for tests to overwrite where the codesign binary is. If this isn't 47 | // specified then we use `xcrun notarytool` as the base. 48 | BaseCmd *exec.Cmd 49 | } 50 | 51 | // Notarize performs the notarization process for macOS applications. This 52 | // will block for the duration of this process which can take many minutes. 53 | // The Status field in Options can be used to get status change notifications. 54 | // 55 | // This will return the notarization info and an error if any occurred. 56 | // The Info result _may_ be non-nil in the presence of an error and can be 57 | // used to gather more information about the notarization attempt. 58 | // 59 | // If error is nil, then Info is guaranteed to be non-nil. 60 | // If error is not nil, notarization failed and Info _may_ be non-nil. 61 | func Notarize(ctx context.Context, opts *Options) (*Info, *Log, error) { 62 | logger := opts.Logger 63 | if logger == nil { 64 | logger = hclog.NewNullLogger() 65 | } 66 | 67 | status := opts.Status 68 | if status == nil { 69 | status = noopStatus{} 70 | } 71 | 72 | lock := opts.UploadLock 73 | if lock == nil { 74 | lock = &sync.Mutex{} 75 | } 76 | 77 | // First perform the upload 78 | lock.Lock() 79 | status.Submitting() 80 | uuid, err := upload(ctx, opts) 81 | lock.Unlock() 82 | if err != nil { 83 | return nil, nil, err 84 | } 85 | status.Submitted(uuid) 86 | 87 | // Begin polling the info. The first thing we wait for is for the status 88 | // _to even exist_. While we get an error requesting info with an error 89 | // code of 1519 (UUID not found), then we are stuck in a queue. Sometimes 90 | // this queue is hours long. We just have to wait. 91 | infoResult := &Info{RequestUUID: uuid} 92 | for { 93 | time.Sleep(10 * time.Second) 94 | _, err := info(ctx, infoResult.RequestUUID, opts) 95 | if err == nil { 96 | break 97 | } 98 | 99 | // If we got error code 1519 that means that the UUID was not found. 100 | // This means we're in a queue. 101 | if e, ok := err.(Errors); ok && e.ContainsCode(1519) { 102 | continue 103 | } 104 | 105 | // A real error, just return that 106 | return infoResult, nil, err 107 | } 108 | 109 | // Now that the UUID result has been found, we poll more quickly 110 | // waiting for the analysis to complete. This usually happens within 111 | // minutes. 112 | for { 113 | // Update the info. It is possible for this to return a nil info 114 | // and we dont' ever want to set result to nil so we have a check. 115 | newInfoResult, err := info(ctx, infoResult.RequestUUID, opts) 116 | if newInfoResult != nil { 117 | infoResult = newInfoResult 118 | } 119 | 120 | if err != nil { 121 | // This code is the network became unavailable error. If this 122 | // happens then we just log and retry. 123 | if e, ok := err.(Errors); ok && e.ContainsCode(-19000) { 124 | logger.Warn("error that network became unavailable, will retry") 125 | goto RETRYINFO 126 | } 127 | 128 | return infoResult, nil, err 129 | } 130 | 131 | status.InfoStatus(*infoResult) 132 | 133 | // If we reached a terminal state then exit 134 | if infoResult.Status == "Accepted" || infoResult.Status == "Invalid" { 135 | break 136 | } 137 | 138 | RETRYINFO: 139 | // Sleep, we just do a constant poll every 5 seconds. I haven't yet 140 | // found any rate limits to the service so this seems okay. 141 | time.Sleep(5 * time.Second) 142 | } 143 | 144 | logResult := &Log{JobId: uuid} 145 | for { 146 | // Update the log. It is possible for this to return a nil log 147 | // and we dont' ever want to set result to nil so we have a check. 148 | newLogResult, err := log(ctx, logResult.JobId, opts) 149 | if newLogResult != nil { 150 | logResult = newLogResult 151 | } 152 | 153 | if err != nil { 154 | // This code is the network became unavailable error. If this 155 | // happens then we just log and retry. 156 | if e, ok := err.(Errors); ok && e.ContainsCode(-19000) { 157 | logger.Warn("error that network became unavailable, will retry") 158 | goto RETRYLOG 159 | } 160 | 161 | return infoResult, logResult, err 162 | } 163 | 164 | status.LogStatus(*logResult) 165 | 166 | // If we reached a terminal state then exit 167 | if logResult.Status == "Accepted" || logResult.Status == "Invalid" { 168 | break 169 | } 170 | 171 | RETRYLOG: 172 | // Sleep, we just do a constant poll every 5 seconds. I haven't yet 173 | // found any rate limits to the service so this seems okay. 174 | time.Sleep(5 * time.Second) 175 | } 176 | 177 | // If we're in an invalid status then return an error 178 | err = nil 179 | if logResult.Status == "Invalid" && infoResult.Status == "Invalid" { 180 | err = fmt.Errorf("package is invalid.") 181 | } 182 | 183 | return infoResult, logResult, err 184 | } 185 | -------------------------------------------------------------------------------- /notarize/notarize_test.go: -------------------------------------------------------------------------------- 1 | package notarize 2 | 3 | import ( 4 | "os" 5 | "os/exec" 6 | "path/filepath" 7 | "testing" 8 | 9 | "github.com/hashicorp/go-hclog" 10 | ) 11 | 12 | func TestMain(m *testing.M) { 13 | // Set our default logger 14 | logger := hclog.L() 15 | logger.SetLevel(hclog.Trace) 16 | hclog.SetDefault(logger) 17 | 18 | // If we got a subcommand, run that 19 | if v := os.Getenv(childEnv); v != "" && childCommands[v] != nil { 20 | os.Exit(childCommands[v]()) 21 | } 22 | 23 | os.Exit(m.Run()) 24 | } 25 | 26 | // childEnv is the env var that must be set to trigger a child command. 27 | const childEnv = "GON_TEST_CHILD" 28 | 29 | // childCommands is the list of commands we support 30 | var childCommands = map[string]func() int{} 31 | 32 | // childCmd is used to create a command that executes a command in the 33 | // childCommands map in a new process. 34 | func childCmd(t *testing.T, name string, args ...string) *exec.Cmd { 35 | t.Helper() 36 | 37 | // Get the path to our executable 38 | selfPath, err := filepath.Abs(os.Args[0]) 39 | if err != nil { 40 | t.Fatalf("error creating child command: %s", err) 41 | return nil 42 | } 43 | 44 | cmd := exec.Command(selfPath, args...) 45 | cmd.Env = os.Environ() 46 | cmd.Env = append(cmd.Env, childEnv+"="+name) 47 | cmd.Stdout = os.Stdout 48 | cmd.Stderr = os.Stderr 49 | 50 | return cmd 51 | } 52 | -------------------------------------------------------------------------------- /notarize/status.go: -------------------------------------------------------------------------------- 1 | package notarize 2 | 3 | // Status is an interface that can be implemented to receive status callbacks. 4 | // 5 | // All the methods in this interface must NOT block for too long or it'll 6 | // block the notarization process. 7 | type Status interface { 8 | // Submitting is called when the file is being submitted for notarization. 9 | Submitting() 10 | 11 | // Submitted is called when the file is submitted to Apple for notarization. 12 | // The arguments give you access to the requestUUID to query more information. 13 | Submitted(requestUUID string) 14 | 15 | // InfoStatus is called as the status of the submitted package changes. 16 | // The info argument contains additional information about the status. 17 | // Note that some fields in the info argument may not be populated, please 18 | // refer to the docs. 19 | InfoStatus(Info) 20 | 21 | // LogStatus is called as the status of the submitted package changes. 22 | LogStatus(Log) 23 | } 24 | 25 | // noopStatus implements Status and does nothing. 26 | type noopStatus struct{} 27 | 28 | func (noopStatus) Submitting() {} 29 | func (noopStatus) Submitted(string) {} 30 | func (noopStatus) InfoStatus(Info) {} 31 | func (noopStatus) LogStatus(Log) {} 32 | 33 | // Assert that we always implement it 34 | var _ Status = noopStatus{} 35 | -------------------------------------------------------------------------------- /notarize/upload.go: -------------------------------------------------------------------------------- 1 | package notarize 2 | 3 | import ( 4 | "bytes" 5 | "context" 6 | "fmt" 7 | "io" 8 | "os/exec" 9 | "path/filepath" 10 | 11 | "github.com/hashicorp/go-hclog" 12 | "howett.net/plist" 13 | ) 14 | 15 | // upload submits the file for notarization and returns the request UUID 16 | // or an error. 17 | func upload(ctx context.Context, opts *Options) (string, error) { 18 | logger := opts.Logger 19 | if logger == nil { 20 | logger = hclog.NewNullLogger() 21 | } 22 | 23 | // Build our command 24 | var cmd exec.Cmd 25 | if opts.BaseCmd != nil { 26 | cmd = *opts.BaseCmd 27 | } 28 | 29 | // We only set the path if it isn't set. This lets the options set the 30 | // path to the codesigning binary that we use. 31 | if cmd.Path == "" { 32 | path, err := exec.LookPath("xcrun") 33 | if err != nil { 34 | return "", err 35 | } 36 | cmd.Path = path 37 | } 38 | 39 | cmd.Args = []string{ 40 | filepath.Base(cmd.Path), 41 | "notarytool", 42 | "submit", opts.File, 43 | "--apple-id", opts.DeveloperId, 44 | "--password", opts.Password, 45 | "--team-id", opts.Provider, 46 | "--output-format", "plist", 47 | } 48 | 49 | // We store all output in out for logging and in case there is an error 50 | var out, combined bytes.Buffer 51 | cmd.Stdout = io.MultiWriter(&out, &combined) 52 | cmd.Stderr = &combined 53 | 54 | // Log what we're going to execute 55 | logger.Info("submitting file for notarization", 56 | "file", opts.File, 57 | "command_path", cmd.Path, 58 | "command_args", cmd.Args, 59 | ) 60 | 61 | // Execute 62 | err := cmd.Run() 63 | 64 | // Log the result 65 | logger.Info("notarization submission complete", 66 | "output", out.String(), 67 | "err", err, 68 | ) 69 | 70 | // If we have any output, try to decode that since even in the case of 71 | // an error it will output some information. 72 | var result uploadResult 73 | if out.Len() > 0 { 74 | if _, perr := plist.Unmarshal(out.Bytes(), &result); perr != nil { 75 | return "", fmt.Errorf("failed to decode notarization submission output: %w", perr) 76 | } 77 | } 78 | 79 | // Now we check the error for actually running the process 80 | if err != nil { 81 | return "", fmt.Errorf("error submitting for notarization:\n\n%s", combined.String()) 82 | } 83 | 84 | // We should have a request UUID set at this point since we checked for errors 85 | if result.RequestUUID == "" { 86 | return "", fmt.Errorf( 87 | "notarization appeared to succeed, but we failed at parsing " + 88 | "the request UUID. Please enable logging, try again, and report " + 89 | "this as a bug.") 90 | } 91 | 92 | logger.Info("notarization request submitted", "request_id", result.RequestUUID) 93 | return result.RequestUUID, nil 94 | 95 | } 96 | 97 | // uploadResult is the plist structure when the upload succeeds 98 | type uploadResult struct { 99 | // Upload is non-nil if there is a successful upload 100 | RequestUUID string `plist:"id"` 101 | } 102 | -------------------------------------------------------------------------------- /notarize/upload_test.go: -------------------------------------------------------------------------------- 1 | package notarize 2 | 3 | import ( 4 | "context" 5 | "fmt" 6 | "strings" 7 | "testing" 8 | 9 | "github.com/hashicorp/go-hclog" 10 | "github.com/stretchr/testify/require" 11 | ) 12 | 13 | func init() { 14 | childCommands["upload-success"] = testCmdUploadSuccess 15 | childCommands["upload-exit-status"] = testCmdUploadExitStatus 16 | } 17 | 18 | func TestUpload_success(t *testing.T) { 19 | uuid, err := upload(context.Background(), &Options{ 20 | Logger: hclog.L(), 21 | BaseCmd: childCmd(t, "upload-success"), 22 | }) 23 | 24 | require.NoError(t, err) 25 | require.Equal(t, uuid, "cfd69166-8e2f-1397-8636-ec06f98e3597") 26 | } 27 | 28 | func TestUpload_exitStatus(t *testing.T) { 29 | uuid, err := upload(context.Background(), &Options{ 30 | Logger: hclog.L(), 31 | BaseCmd: childCmd(t, "upload-exit-status"), 32 | }) 33 | 34 | require.Error(t, err) 35 | require.Empty(t, uuid) 36 | } 37 | 38 | // testCmdUploadSuccess mimicks a successful submission. 39 | func testCmdUploadSuccess() int { 40 | fmt.Println(strings.TrimSpace(` 41 | 42 | 43 | 44 | 45 | id 46 | cfd69166-8e2f-1397-8636-ec06f98e3597 47 | message 48 | Successfully uploaded file 49 | path 50 | /path/to/binary.zip 51 | 52 | 53 | `)) 54 | return 0 55 | } 56 | 57 | // testCmdUploadExitStatus 58 | func testCmdUploadExitStatus() int { 59 | return 1 60 | } 61 | -------------------------------------------------------------------------------- /package/dmg/dmg.go: -------------------------------------------------------------------------------- 1 | // Package dmg creates a "dmg" disk image. This package is purposely 2 | // skewed towards the features required for notarization with gon and 3 | // isn't meant to be a general purpose dmg creation library. 4 | // 5 | // This package works by embedding create-dmg[1] into the binary, 6 | // self-extracting to a temporary directory, and executing the script. This is 7 | // NOT a pure Go implementation of dmg creation. Please understand the risks 8 | // associated with this before choosing to use this package. 9 | // 10 | // [1]: https://github.com/andreyvit/create-dmg 11 | package dmg 12 | 13 | import ( 14 | "bytes" 15 | "context" 16 | "fmt" 17 | "io/ioutil" 18 | "os" 19 | "os/exec" 20 | "path/filepath" 21 | 22 | "github.com/hashicorp/go-hclog" 23 | 24 | "github.com/mitchellh/gon/internal/createdmg" 25 | ) 26 | 27 | // Options are the options for creating the dmg archive. 28 | type Options struct { 29 | // Files is a list of files to put into the root of the dmg. This is 30 | // expected to contain already-signed binaries and so on. This overlaps 31 | // fully with Root so if no files are specified here and Root is specified 32 | // we can still create a Dmg. 33 | // 34 | // If both Files and Root are set, we'll add this list of files to the 35 | // root directory in the dmg. 36 | Files []string 37 | 38 | // Root is the directory to use as the root of the dmg file. This can 39 | // optionally be set to specify additional files that you want within 40 | // the dmg. If this isn't set, we'll create a root with the files specified 41 | // in Files. 42 | Root string 43 | 44 | // OutputPath is the path where the dmg file will be written. The directory 45 | // containing this path must already exist. If a file already exist here 46 | // it will be overwritten. 47 | OutputPath string 48 | 49 | // VolumeName is the name of the dmg volume when mounted. 50 | VolumeName string 51 | 52 | // Logger is the logger to use. If this is nil then no logging will be done. 53 | Logger hclog.Logger 54 | 55 | // BaseCmd is the base command for executing the codesign binary. This is 56 | // used for tests to overwrite where the codesign binary is. 57 | BaseCmd *exec.Cmd 58 | } 59 | 60 | // Dmg creates a dmg archive for notarization using the options given. 61 | func Dmg(ctx context.Context, opts *Options) error { 62 | logger := opts.Logger 63 | if logger == nil { 64 | logger = hclog.NewNullLogger() 65 | } 66 | 67 | // Build our command 68 | var cmd *exec.Cmd 69 | if opts.BaseCmd != nil { 70 | cmdCopy := *opts.BaseCmd 71 | cmd = &cmdCopy 72 | } 73 | 74 | // If the options didn't set a command, we do so from our vendored create-dmg 75 | if cmd == nil { 76 | var err error 77 | cmd, err = createdmg.Cmd(ctx) 78 | if err != nil { 79 | return err 80 | } 81 | defer createdmg.Close(cmd) 82 | } 83 | 84 | // Set our basic settings 85 | args := []string{ 86 | filepath.Base(cmd.Path), // argv[0] 87 | "--volname", opts.VolumeName, 88 | } 89 | 90 | // Inject our files 91 | for _, f := range opts.Files { 92 | args = append(args, "--add-file", filepath.Base(f), f, "0", "0") 93 | } 94 | 95 | // Set our root directory. If one wasn't specified, we create an empty 96 | // temporary directory to act as our root and we just use the flags to 97 | // inject our files. 98 | root := opts.Root 99 | if root == "" { 100 | td, err := ioutil.TempDir("", "gon") 101 | if err != nil { 102 | return err 103 | } 104 | defer os.RemoveAll(td) 105 | root = td 106 | } 107 | 108 | // Add the final arguments and set it on cmd 109 | cmd.Args = append(args, opts.OutputPath, root) 110 | 111 | // If our output path exists prior to running, we have to delete that 112 | if _, err := os.Stat(opts.OutputPath); err == nil { 113 | logger.Info("output path exists, removing", "path", opts.OutputPath) 114 | if err := os.Remove(opts.OutputPath); err != nil { 115 | return err 116 | } 117 | } 118 | 119 | // We store all output in out for logging and in case there is an error 120 | var out bytes.Buffer 121 | cmd.Stdout = &out 122 | cmd.Stderr = cmd.Stdout 123 | 124 | // Log what we're going to execute 125 | logger.Info("executing create-dmg for dmg creation", 126 | "output_path", opts.OutputPath, 127 | "command_path", cmd.Path, 128 | "command_args", cmd.Args, 129 | ) 130 | 131 | // Execute 132 | if err := cmd.Run(); err != nil { 133 | logger.Error("error creating dmg", "err", err, "output", out.String()) 134 | return fmt.Errorf("error creating dmg:\n\n%s", out.String()) 135 | } 136 | 137 | logger.Info("dmg creation complete", "output", out.String()) 138 | return nil 139 | } 140 | -------------------------------------------------------------------------------- /package/zip/zip.go: -------------------------------------------------------------------------------- 1 | // Package zip creates the "zip" package format for notarization. 2 | package zip 3 | 4 | import ( 5 | "bytes" 6 | "context" 7 | "io/ioutil" 8 | "os" 9 | "os/exec" 10 | "path/filepath" 11 | 12 | "github.com/hashicorp/go-hclog" 13 | ) 14 | 15 | // Options are the options for creating the zip archive. 16 | type Options struct { 17 | // Files to add to the zip package. 18 | Files []string 19 | 20 | // OutputPath is the path where the zip file will be written. The directory 21 | // containing this path must already exist. If a file already exist here 22 | // it will be overwritten. 23 | OutputPath string 24 | 25 | // Logger is the logger to use. If this is nil then no logging will be done. 26 | Logger hclog.Logger 27 | 28 | // BaseCmd is the base command for executing the codesign binary. This is 29 | // used for tests to overwrite where the codesign binary is. 30 | BaseCmd *exec.Cmd 31 | } 32 | 33 | // Zip creates a zip archive for notarization using the options given. 34 | // 35 | // For now this works by subprocessing to "ditto" which is the recommended 36 | // mechanism by the Apple documentation. We could in the future change to 37 | // using pure Go but given the requirement of gon to run directly on macOS 38 | // machines, we can be sure ditto exists and produces valid output. 39 | func Zip(ctx context.Context, opts *Options) error { 40 | logger := opts.Logger 41 | if logger == nil { 42 | logger = hclog.NewNullLogger() 43 | } 44 | 45 | // Setup our root directory with the given files. 46 | root, err := createRoot(ctx, logger, opts) 47 | if err != nil { 48 | return err 49 | } 50 | defer os.RemoveAll(root) 51 | 52 | // Make our command for creating the archive 53 | cmd, err := dittoCmd(ctx, opts.BaseCmd) 54 | if err != nil { 55 | return err 56 | } 57 | 58 | cmd.Args = []string{ 59 | filepath.Base(cmd.Path), 60 | "-c", // create an archive 61 | "-k", // create a PKZip archive, not CPIO 62 | } 63 | cmd.Args = append(cmd.Args, root) 64 | cmd.Args = append(cmd.Args, opts.OutputPath) 65 | 66 | // We store all output in out for logging and in case there is an error 67 | var out bytes.Buffer 68 | cmd.Stdout = &out 69 | cmd.Stderr = cmd.Stdout 70 | 71 | // Log what we're going to execute 72 | logger.Info("executing ditto for zip archive creation", 73 | "output_path", opts.OutputPath, 74 | "command_path", cmd.Path, 75 | "command_args", cmd.Args, 76 | ) 77 | 78 | // Execute 79 | if err = cmd.Run(); err != nil { 80 | logger.Error("error creating zip archive", "err", err, "output", out.String()) 81 | return err 82 | } 83 | 84 | logger.Info("zip archive creation complete", "output", out.String()) 85 | return nil 86 | } 87 | 88 | // dittoCmd returns an *exec.Cmd ready for executing `ditto` based on 89 | // the given base command. 90 | func dittoCmd(ctx context.Context, base *exec.Cmd) (*exec.Cmd, error) { 91 | path, err := exec.LookPath("ditto") 92 | if err != nil { 93 | return nil, err 94 | } 95 | 96 | // Copy the base command so we don't modify it. If it isn't set then 97 | // we create a new command. 98 | var cmd *exec.Cmd 99 | if base == nil { 100 | cmd = exec.CommandContext(ctx, path) 101 | } else { 102 | cmdCopy := *base 103 | cmd = &cmdCopy 104 | } 105 | 106 | // We only set the path if it isn't set. This lets the options set the 107 | // path to the codesigning binary that we use. 108 | if cmd.Path == "" { 109 | cmd.Path = path 110 | } 111 | 112 | return cmd, nil 113 | } 114 | 115 | // createRoot creates a root directory we can use `ditto` that contains all 116 | // the given Files as input. This lets us support multiple files. 117 | // 118 | // If the returned directory value is non-empty, you must defer to remove 119 | // the directory since it is meant to be a temporary directory. 120 | // 121 | // The directory is guaranteed to be empty if error is non-nil. 122 | func createRoot(ctx context.Context, logger hclog.Logger, opts *Options) (string, error) { 123 | // Build our copy command 124 | cmd, err := dittoCmd(ctx, opts.BaseCmd) 125 | if err != nil { 126 | return "", err 127 | } 128 | 129 | // Create our root directory 130 | root, err := ioutil.TempDir("", "gon-createzip") 131 | if err != nil { 132 | return "", err 133 | } 134 | 135 | // Setup our args to copy our files into the root 136 | cmd.Args = []string{ 137 | filepath.Base(cmd.Path), 138 | } 139 | cmd.Args = append(cmd.Args, opts.Files...) 140 | cmd.Args = append(cmd.Args, root) 141 | 142 | // We store all output in out for logging and in case there is an error 143 | var out bytes.Buffer 144 | cmd.Stdout = &out 145 | cmd.Stderr = cmd.Stdout 146 | 147 | // Log what we're going to execute 148 | logger.Info("executing ditto to copy files for archiving", 149 | "output_path", opts.OutputPath, 150 | "command_path", cmd.Path, 151 | "command_args", cmd.Args, 152 | ) 153 | 154 | // Execute copy 155 | if err = cmd.Run(); err != nil { 156 | os.RemoveAll(root) 157 | 158 | logger.Error( 159 | "error copying source files to create zip archive", 160 | "err", err, 161 | "output", out.String(), 162 | ) 163 | return "", err 164 | } 165 | 166 | return root, nil 167 | } 168 | -------------------------------------------------------------------------------- /sign/sign.go: -------------------------------------------------------------------------------- 1 | // Package sign codesigns files. 2 | package sign 3 | 4 | import ( 5 | "bytes" 6 | "context" 7 | "fmt" 8 | "io" 9 | "os/exec" 10 | 11 | "github.com/hashicorp/go-hclog" 12 | ) 13 | 14 | // Options are the options for Sign. 15 | type Options struct { 16 | // Files are the list of files to sign. This is required. The files 17 | // will be signed _in-place_ so you must take care to copy the files 18 | // to a new location if you do not want these files modified. 19 | Files []string 20 | 21 | // Identity is the identity to use for the signing operation. This is required. 22 | // This value must be a valid value for the `-s` flag for the `codesign` 23 | // binary. See the man pages for that for more help since the value can 24 | // be in a variety of forms. 25 | Identity string 26 | 27 | // Entitlements is an (optional) path to a plist format .entitlements file 28 | Entitlements string 29 | 30 | // Output is an io.Writer where the output of the command will be written. 31 | // If this is nil then the output will only be sent to the log (if set) 32 | // or in the error result value if signing failed. 33 | Output io.Writer 34 | 35 | // Logger is the logger to use. If this is nil then no logging will be done. 36 | Logger hclog.Logger 37 | 38 | // BaseCmd is the base command for executing the codesign binary. This is 39 | // used for tests to overwrite where the codesign binary is. 40 | BaseCmd *exec.Cmd 41 | } 42 | 43 | // Sign signs one or more files returning an error if any. 44 | func Sign(ctx context.Context, opts *Options) error { 45 | logger := opts.Logger 46 | if logger == nil { 47 | logger = hclog.NewNullLogger() 48 | } 49 | 50 | // Build our command 51 | var cmd exec.Cmd 52 | if opts.BaseCmd != nil { 53 | cmd = *opts.BaseCmd 54 | } 55 | 56 | // We only set the path if it isn't set. This lets the options set the 57 | // path to the codesigning binary that we use. 58 | if cmd.Path == "" { 59 | path, err := exec.LookPath("codesign") 60 | if err != nil { 61 | return err 62 | } 63 | cmd.Path = path 64 | } 65 | 66 | cmd.Args = []string{ 67 | "codesign", 68 | "-s", opts.Identity, 69 | "-f", 70 | "-v", 71 | "--timestamp", 72 | "--options", "runtime", 73 | } 74 | 75 | if len(opts.Entitlements) > 0 { 76 | cmd.Args = append(cmd.Args, "--entitlements", opts.Entitlements) 77 | } 78 | 79 | // Append the files that we want to sign 80 | cmd.Args = append(cmd.Args, opts.Files...) 81 | 82 | // We store all output in out for logging and in case there is an error 83 | var out bytes.Buffer 84 | cmd.Stdout = &out 85 | 86 | // If we have an output set, we write to both 87 | if opts.Output != nil { 88 | cmd.Stdout = io.MultiWriter(cmd.Stdout, opts.Output) 89 | } 90 | 91 | // We send stderr to the same place as stdout 92 | cmd.Stderr = cmd.Stdout 93 | 94 | // Log what we're going to execute 95 | logger.Info("executing codesigning", 96 | "files", opts.Files, 97 | "command_path", cmd.Path, 98 | "command_args", cmd.Args, 99 | ) 100 | 101 | // Execute 102 | if err := cmd.Run(); err != nil { 103 | logger.Error("error codesigning", "err", err, "output", out.String()) 104 | return fmt.Errorf("error signing:\n\n%s", out.String()) 105 | } 106 | 107 | logger.Info("codesigning complete", "output", out.String()) 108 | return nil 109 | } 110 | -------------------------------------------------------------------------------- /sign/sign_children_test.go: -------------------------------------------------------------------------------- 1 | package sign 2 | 3 | import ( 4 | "os" 5 | "os/exec" 6 | "path/filepath" 7 | "testing" 8 | ) 9 | 10 | // childEnv is the env var that must be set to trigger a child command. 11 | const childEnv = "GON_TEST_CHILD" 12 | 13 | // childCommands is the list of commands we support 14 | var childCommands = map[string]func() int{ 15 | "success": childSuccess, 16 | } 17 | 18 | // childCmd is used to create a command that executes a command in the 19 | // childCommands map in a new process. 20 | func childCmd(t *testing.T, name string, args ...string) *exec.Cmd { 21 | t.Helper() 22 | 23 | // Get the path to our executable 24 | selfPath, err := filepath.Abs(os.Args[0]) 25 | if err != nil { 26 | t.Fatalf("error creating child command: %s", err) 27 | return nil 28 | } 29 | 30 | cmd := exec.Command(selfPath, args...) 31 | cmd.Env = os.Environ() 32 | cmd.Env = append(cmd.Env, childEnv+"="+name) 33 | cmd.Stdout = os.Stdout 34 | cmd.Stderr = os.Stderr 35 | 36 | return cmd 37 | } 38 | 39 | func childSuccess() int { 40 | println("success") 41 | return 0 42 | } 43 | -------------------------------------------------------------------------------- /sign/sign_test.go: -------------------------------------------------------------------------------- 1 | package sign 2 | 3 | import ( 4 | "context" 5 | "os" 6 | "testing" 7 | 8 | "github.com/hashicorp/go-hclog" 9 | "github.com/stretchr/testify/require" 10 | ) 11 | 12 | func TestMain(m *testing.M) { 13 | // Set our default logger 14 | logger := hclog.L() 15 | logger.SetLevel(hclog.Trace) 16 | hclog.SetDefault(logger) 17 | 18 | // If we got a subcommand, run that 19 | if v := os.Getenv(childEnv); v != "" && childCommands[v] != nil { 20 | os.Exit(childCommands[v]()) 21 | } 22 | 23 | os.Exit(m.Run()) 24 | } 25 | 26 | func TestSign_success(t *testing.T) { 27 | require.NoError(t, Sign(context.Background(), &Options{ 28 | Files: []string{"foo"}, 29 | Identity: "bar", 30 | Logger: hclog.L(), 31 | BaseCmd: childCmd(t, "success"), 32 | })) 33 | } 34 | -------------------------------------------------------------------------------- /staple/staple.go: -------------------------------------------------------------------------------- 1 | // Package staple staples a notarization ticket to a file, allowing it 2 | // to be validated offline. This only works for files of type "app", "dmg", 3 | // or "pkg". 4 | package staple 5 | 6 | import ( 7 | "bytes" 8 | "context" 9 | "fmt" 10 | "os/exec" 11 | "path/filepath" 12 | 13 | "github.com/hashicorp/go-hclog" 14 | ) 15 | 16 | // Options are the options for creating the zip archive. 17 | type Options struct { 18 | // File to staple. It is stapled in-place. 19 | File string 20 | 21 | // Logger is the logger to use. If this is nil then no logging will be done. 22 | Logger hclog.Logger 23 | 24 | // BaseCmd is the base command for executing the codesign binary. This is 25 | // used for tests to overwrite where the codesign binary is. 26 | BaseCmd *exec.Cmd 27 | } 28 | 29 | // Staple staples the notarization ticket to a file. 30 | func Staple(ctx context.Context, opts *Options) error { 31 | logger := opts.Logger 32 | if logger == nil { 33 | logger = hclog.NewNullLogger() 34 | } 35 | 36 | // Build our command 37 | var cmd exec.Cmd 38 | if opts.BaseCmd != nil { 39 | cmd = *opts.BaseCmd 40 | } 41 | 42 | // We only set the path if it isn't set. This lets the options set the 43 | // path to the codesigning binary that we use. 44 | if cmd.Path == "" { 45 | path, err := exec.LookPath("xcrun") 46 | if err != nil { 47 | return err 48 | } 49 | cmd.Path = path 50 | } 51 | 52 | cmd.Args = []string{ 53 | filepath.Base(cmd.Path), 54 | "stapler", 55 | "staple", 56 | opts.File, 57 | } 58 | 59 | // We store all output in out for logging and in case there is an error 60 | var out bytes.Buffer 61 | cmd.Stdout = &out 62 | cmd.Stderr = cmd.Stdout 63 | 64 | // Log what we're going to execute 65 | logger.Info("executing stapler", 66 | "file", opts.File, 67 | "command_path", cmd.Path, 68 | "command_args", cmd.Args, 69 | ) 70 | 71 | // Execute 72 | if err := cmd.Run(); err != nil { 73 | logger.Error("error stapling", "err", err, "output", out.String()) 74 | return fmt.Errorf("error stapling:\n\n%s", out.String()) 75 | } 76 | 77 | logger.Info("stapling complete", "file", opts.File) 78 | return nil 79 | } 80 | -------------------------------------------------------------------------------- /vendor/README.md: -------------------------------------------------------------------------------- 1 | # Vendored Projects 2 | 3 | This folder contains vendored 3rd-party projects, libraries, etc. 4 | We commit this to our Git repo as long as licensing allows us to so that 5 | our builds continue to work properly even if the project changes or 6 | is inaccessible. 7 | -------------------------------------------------------------------------------- /vendor/create-dmg/.gitignore: -------------------------------------------------------------------------------- 1 | .svn 2 | 3 | *.dmg 4 | .DS_Store 5 | -------------------------------------------------------------------------------- /vendor/create-dmg/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2008-2014 Andrey Tarantsov 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /vendor/create-dmg/README.md: -------------------------------------------------------------------------------- 1 | create-dmg 2 | ========== 3 | 4 | A shell script to build fancy DMGs. 5 | 6 | 7 | Status and contribution policy 8 | ------------------------------ 9 | 10 | This project is maintained thanks to the contributors who send pull requests, and now (Sep 2018) with the help of [@aonez](https://github.com/aonez). 11 | 12 | We will merge any pull request that adds something useful and does not break existing things, and will often grant commit access to the repository. 13 | 14 | If you're an active user and want to be a maintainer, or just want to chat, please ping us at [gitter.im/create-dmg/Lobby](https://gitter.im/create-dmg/Lobby). 15 | 16 | 17 | Installation 18 | ------------ 19 | 20 | - You can install this script using [Homebrew](https://brew.sh): 21 | 22 | ```sh 23 | brew install create-dmg 24 | ``` 25 | 26 | - You can download the [latest release](https://github.com/andreyvit/create-dmg/releases/latest) 27 | 28 | - You can also clone the entire repository: 29 | 30 | ```sh 31 | git clone https://github.com/andreyvit/create-dmg.git 32 | ``` 33 | 34 | Usage 35 | ----- 36 | 37 | ```sh 38 | create-dmg [options...] [output\_name.dmg] [source\_folder] 39 | ``` 40 | 41 | All contents of source\_folder will be copied into the disk image. 42 | 43 | **Options:** 44 | 45 | * **--volname [name]:** set volume name (displayed in the Finder sidebar and window title) 46 | * **--volicon [icon.icns]:** set volume icon 47 | * **--background [pic.png]:** set folder background image (provide png, gif, jpg) 48 | * **--window-pos [x y]:** set position the folder window 49 | * **--window-size [width height]:** set size of the folder window 50 | * **--text-size [text size]:** set window text size (10-16) 51 | * **--icon-size [icon size]:** set window icons size (up to 128) 52 | * **--icon [file name] [x y]:** set position of the file's icon 53 | * **--hide-extension [file name]:** hide the extension of file 54 | * **--custom-icon [file name]/[custom icon]/[sample file] [x y]:** set position and custom icon 55 | * **--app-drop-link [x y]:** make a drop link to Applications, at location x, y 56 | * **--ql-drop-link [x y]:** make a drop link to /Library/QuickLook, at location x, y 57 | * **--eula [eula file]:** attach a license file to the dmg 58 | * **--rez [rez path]:** specify custom path to Rez tool used to include license file 59 | * **--no-internet-enable:** disable automatic mount© 60 | * **--format:** specify the final image format (default is UDZO) 61 | * **--add-file [target name] [path to source file] [x y]:** add additional file (option can be used multiple times) 62 | * **--add-folder [target name] [path to source folder] [x y]:** add additional folder (option can be used multiple times) 63 | * **--disk-image-size [x]:** set the disk image size manually to x MB 64 | * **--hdiutil-verbose:** execute hdiutil in verbose mode 65 | * **--hdiutil-quiet:** execute hdiutil in quiet mode 66 | * **--sandbox-safe:** execute hdiutil with sandbox compatibility and don not bless 67 | * **--version:** show tool version number 68 | * **-h, --help:** display the help 69 | 70 | 71 | Example 72 | ------- 73 | 74 | ```sh 75 | #!/bin/sh 76 | test -f Application-Installer.dmg && rm Application-Installer.dmg 77 | create-dmg \ 78 | --volname "Application Installer" \ 79 | --volicon "application\_icon.icns" \ 80 | --background "installer\_background.png" \ 81 | --window-pos 200 120 \ 82 | --window-size 800 400 \ 83 | --icon-size 100 \ 84 | --icon "Application.app" 200 190 \ 85 | --hide-extension "Application.app" \ 86 | --app-drop-link 600 185 \ 87 | "Application-Installer.dmg" \ 88 | "source_folder/" 89 | ``` 90 | 91 | Alternatives 92 | ------------ 93 | 94 | * [node-appdmg](https://github.com/LinusU/node-appdmg) 95 | * [dmgbuild](https://pypi.python.org/pypi/dmgbuild) 96 | * see the [StackOverflow question](http://stackoverflow.com/questions/96882/how-do-i-create-a-nice-looking-dmg-for-mac-os-x-using-command-line-tools) 97 | -------------------------------------------------------------------------------- /vendor/create-dmg/builder/create-dmg.builder: -------------------------------------------------------------------------------- 1 | SET app_name create-dmg 2 | 3 | VERSION create-dmg.cur create-dmg heads/master 4 | 5 | NEWDIR build.dir temp %-build - 6 | 7 | NEWFILE create-dmg.zip featured %.zip % 8 | 9 | 10 | COPYTO [build.dir] 11 | INTO create-dmg [create-dmg.cur]/create-dmg 12 | INTO sample [create-dmg.cur]/sample 13 | INTO support [create-dmg.cur]/support 14 | 15 | SUBSTVARS [build.dir]/create-dmg [[]] 16 | 17 | 18 | ZIP [create-dmg.zip] 19 | INTO [build-files-prefix] [build.dir] 20 | 21 | 22 | PUT megabox-builds create-dmg.zip 23 | PUT megabox-builds build.log 24 | 25 | PUT s3-builds create-dmg.zip 26 | PUT s3-builds build.log 27 | -------------------------------------------------------------------------------- /vendor/create-dmg/create-dmg: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Create a read-only disk image of the contents of a folder 4 | 5 | set -e; 6 | 7 | function pure_version() { 8 | echo '1.0.0.6' 9 | } 10 | 11 | function version() { 12 | echo "create-dmg $(pure_version)" 13 | } 14 | 15 | function usage() { 16 | version 17 | echo "Creates a fancy DMG file." 18 | echo "Usage: $(basename $0) [options] " 19 | echo "All contents of source_folder will be copied into the disk image." 20 | echo "Options:" 21 | echo " --volname name" 22 | echo " set volume name (displayed in the Finder sidebar and window title)" 23 | echo " --volicon icon.icns" 24 | echo " set volume icon" 25 | echo " --background pic.png" 26 | echo " set folder background image (provide png, gif, jpg)" 27 | echo " --window-pos x y" 28 | echo " set position the folder window" 29 | echo " --window-size width height" 30 | echo " set size of the folder window" 31 | echo " --text-size text_size" 32 | echo " set window text size (10-16)" 33 | echo " --icon-size icon_size" 34 | echo " set window icons size (up to 128)" 35 | echo " --icon file_name x y" 36 | echo " set position of the file's icon" 37 | echo " --hide-extension file_name" 38 | echo " hide the extension of file" 39 | echo " --custom-icon file_name custom_icon_or_sample_file x y" 40 | echo " set position and custom icon" 41 | echo " --app-drop-link x y" 42 | echo " make a drop link to Applications, at location x,y" 43 | echo " --ql-drop-link x y" 44 | echo " make a drop link to user QuickLook install dir, at location x,y" 45 | echo " --eula eula_file" 46 | echo " attach a license file to the dmg" 47 | echo " --no-internet-enable" 48 | echo " disable automatic mount©" 49 | echo " --format" 50 | echo " specify the final image format (default is UDZO)" 51 | echo " --add-file target_name path_to_source_file x y" 52 | echo " add additional file (option can be used multiple times)" 53 | echo " --add-folder target_name path_to_source_folder x y" 54 | echo " add additional folder (option can be used multiple times)" 55 | echo " --disk-image-size x" 56 | echo " set the disk image size manually to x MB" 57 | echo " --hdiutil-verbose" 58 | echo " execute hdiutil in verbose mode" 59 | echo " --hdiutil-quiet" 60 | echo " execute hdiutil in quiet mode" 61 | echo " --sandbox-safe" 62 | echo " execute hdiutil with sandbox compatibility and do not bless" 63 | echo " --rez rez_path" 64 | echo " use custom path to Rez tool" 65 | echo " --version show tool version number" 66 | echo " -h, --help display this help" 67 | exit 0 68 | } 69 | 70 | WINX=10 71 | WINY=60 72 | WINW=500 73 | WINH=350 74 | ICON_SIZE=128 75 | TEXT_SIZE=16 76 | FORMAT="UDZO" 77 | ADD_FILE_SOURCES=() 78 | ADD_FILE_TARGETS=() 79 | ADD_FOLDER_SOURCES=() 80 | ADD_FOLDER_TARGETS=() 81 | IMAGEKEY="" 82 | HDIUTIL_VERBOSITY="" 83 | SANDBOX_SAFE=0 84 | SKIP_JENKINS=0 85 | 86 | while test "${1:0:1}" = "-"; do 87 | case $1 in 88 | --volname) 89 | VOLUME_NAME="$2" 90 | shift; shift;; 91 | --volicon) 92 | VOLUME_ICON_FILE="$2" 93 | shift; shift;; 94 | --background) 95 | BACKGROUND_FILE="$2" 96 | BACKGROUND_FILE_NAME="$(basename $BACKGROUND_FILE)" 97 | BACKGROUND_CLAUSE="set background picture of opts to file \".background:$BACKGROUND_FILE_NAME\"" 98 | REPOSITION_HIDDEN_FILES_CLAUSE="set position of every item to {theBottomRightX + 100, 100}" 99 | shift; shift;; 100 | --icon-size) 101 | ICON_SIZE="$2" 102 | shift; shift;; 103 | --text-size) 104 | TEXT_SIZE="$2" 105 | shift; shift;; 106 | --window-pos) 107 | WINX=$2; WINY=$3 108 | shift; shift; shift;; 109 | --window-size) 110 | WINW=$2; WINH=$3 111 | shift; shift; shift;; 112 | --icon) 113 | POSITION_CLAUSE="${POSITION_CLAUSE}set position of item \"$2\" to {$3, $4} 114 | " 115 | shift; shift; shift; shift;; 116 | --hide-extension) 117 | HIDING_CLAUSE="${HIDING_CLAUSE}set the extension hidden of item \"$2\" to true 118 | " 119 | shift; shift;; 120 | --custom-icon) 121 | shift; shift; shift; shift; shift;; 122 | -h | --help) 123 | usage;; 124 | --version) 125 | version; exit 0;; 126 | --pure-version) 127 | pure_version; exit 0;; 128 | --ql-drop-link) 129 | QL_LINK=$2 130 | QL_CLAUSE="set position of item \"QuickLook\" to {$2, $3} 131 | " 132 | shift; shift; shift;; 133 | --app-drop-link) 134 | APPLICATION_LINK=$2 135 | APPLICATION_CLAUSE="set position of item \"Applications\" to {$2, $3} 136 | " 137 | shift; shift; shift;; 138 | --eula) 139 | EULA_RSRC=$2 140 | shift; shift;; 141 | --no-internet-enable) 142 | NOINTERNET=1 143 | shift;; 144 | --format) 145 | FORMAT="$2" 146 | shift; shift;; 147 | --add-file) 148 | ADD_FILE_TARGETS+=("$2") 149 | ADD_FILE_SOURCES+=("$3") 150 | POSITION_CLAUSE="${POSITION_CLAUSE} 151 | set position of item \"$2\" to {$4, $5} 152 | " 153 | shift; shift; shift; shift; shift;; 154 | --add-folder) 155 | ADD_FOLDER_TARGETS+=("$2") 156 | ADD_FOLDER_SOURCES+=("$3") 157 | POSITION_CLAUSE="${POSITION_CLAUSE} 158 | set position of item \"$2\" to {$4, $5} 159 | " 160 | shift; shift; shift; shift; shift;; 161 | --disk-image-size) 162 | DISK_IMAGE_SIZE="$2" 163 | shift; shift;; 164 | --hdiutil-verbose) 165 | HDIUTIL_VERBOSITY='-verbose' 166 | shift;; 167 | --hdiutil-quiet) 168 | HDIUTIL_VERBOSITY='-quiet' 169 | shift;; 170 | --sandbox-safe) 171 | SANDBOX_SAFE=1 172 | shift;; 173 | --rez) 174 | REZ_PATH=$2 175 | shift; shift;; 176 | --skip-jenkins) 177 | SKIP_JENKINS=1 178 | shift;; 179 | -*) 180 | echo "Unknown option $1. Run with --help for help." 181 | exit 1;; 182 | esac 183 | case $FORMAT in 184 | UDZO) 185 | IMAGEKEY="-imagekey zlib-level=9";; 186 | UDBZ) 187 | IMAGEKEY="-imagekey bzip2-level=9";; 188 | esac 189 | done 190 | 191 | test -z "$2" && { 192 | echo "Not enough arguments. Invoke with --help for help." 193 | exit 1 194 | } 195 | 196 | SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" 197 | DMG_PATH="$1" 198 | DMG_DIRNAME="$(dirname "$DMG_PATH")" 199 | DMG_DIR="$(cd "$DMG_DIRNAME" > /dev/null; pwd)" 200 | DMG_NAME="$(basename "$DMG_PATH")" 201 | DMG_TEMP_NAME="$DMG_DIR/rw.${DMG_NAME}" 202 | SRC_FOLDER="$(cd "$2" > /dev/null; pwd)" 203 | 204 | test -z "$VOLUME_NAME" && VOLUME_NAME="$(basename "$DMG_PATH" .dmg)" 205 | 206 | # brew formula will set this as 1 and embed the support scripts 207 | BREW_INSTALL=0 208 | 209 | AUX_PATH="$SCRIPT_DIR/support" 210 | 211 | if [ $BREW_INSTALL -eq 0 ]; then 212 | test -d "$AUX_PATH" || { 213 | echo "Cannot find support directory: $AUX_PATH" 214 | exit 1 215 | } 216 | fi 217 | 218 | if [ -f "$SRC_FOLDER/.DS_Store" ]; then 219 | echo "Deleting any .DS_Store in source folder" 220 | rm "$SRC_FOLDER/.DS_Store" 221 | fi 222 | 223 | # Create the image 224 | echo "Creating disk image..." 225 | test -f "${DMG_TEMP_NAME}" && rm -f "${DMG_TEMP_NAME}" 226 | 227 | # Using Megabytes since hdiutil fails with very large Byte numbers 228 | function blocks_to_megabytes() { 229 | # Add 1 extra MB, since there's no decimal retention here 230 | MB_SIZE=$((($1 * 512 / 1000 / 1000) + 1)) 231 | echo $MB_SIZE 232 | } 233 | 234 | function get_size() { 235 | # Get block size in disk 236 | bytes_size=`du -s "$1" | sed -e 's/ .*//g'` 237 | echo `blocks_to_megabytes $bytes_size` 238 | } 239 | 240 | # Create the DMG with the specified size or the hdiutil estimation 241 | CUSTOM_SIZE='' 242 | if ! test -z "$DISK_IMAGE_SIZE"; then 243 | CUSTOM_SIZE="-size ${DISK_IMAGE_SIZE}m" 244 | fi 245 | 246 | if [ $SANDBOX_SAFE -eq 0 ]; then 247 | hdiutil create ${HDIUTIL_VERBOSITY} -srcfolder "$SRC_FOLDER" -volname "${VOLUME_NAME}" -fs HFS+ -fsargs "-c c=64,a=16,e=16" -format UDRW ${CUSTOM_SIZE} "${DMG_TEMP_NAME}" 248 | else 249 | hdiutil makehybrid ${HDIUTIL_VERBOSITY} -default-volume-name "${VOLUME_NAME}" -hfs -o "${DMG_TEMP_NAME}" "$SRC_FOLDER" 250 | hdiutil convert -format UDRW -ov -o "${DMG_TEMP_NAME}" "${DMG_TEMP_NAME}" 251 | DISK_IMAGE_SIZE_CUSTOM=$DISK_IMAGE_SIZE 252 | fi 253 | 254 | # Get the created DMG actual size 255 | DISK_IMAGE_SIZE=`get_size "${DMG_TEMP_NAME}"` 256 | 257 | # Use the custom size if bigger 258 | if [ $SANDBOX_SAFE -eq 1 ] && [ ! -z "$DISK_IMAGE_SIZE_CUSTOM" ] && [ $DISK_IMAGE_SIZE_CUSTOM -gt $DISK_IMAGE_SIZE ]; then 259 | DISK_IMAGE_SIZE=$DISK_IMAGE_SIZE_CUSTOM 260 | fi 261 | 262 | # Estimate the additional soruces size 263 | if ! test -z "$ADD_FILE_SOURCES"; then 264 | for i in "${!ADD_FILE_SOURCES[@]}" 265 | do 266 | SOURCE_SIZE=`get_size "${ADD_FILE_SOURCES[$i]}"` 267 | DISK_IMAGE_SIZE=$(expr $DISK_IMAGE_SIZE + $SOURCE_SIZE) 268 | done 269 | fi 270 | if ! test -z "$ADD_FOLDER_SOURCES"; then 271 | for i in "${!ADD_FOLDER_SOURCES[@]}" 272 | do 273 | SOURCE_SIZE=`get_size "${ADD_FOLDER_SOURCES[$i]}"` 274 | DISK_IMAGE_SIZE=$(expr $DISK_IMAGE_SIZE + $SOURCE_SIZE) 275 | done 276 | fi 277 | 278 | # Add extra space for additional resources 279 | DISK_IMAGE_SIZE=$(expr $DISK_IMAGE_SIZE + 20) 280 | 281 | # Resize the image for the extra stuff 282 | hdiutil resize ${HDIUTIL_VERBOSITY} -size ${DISK_IMAGE_SIZE}m "${DMG_TEMP_NAME}" 283 | 284 | # mount it 285 | echo "Mounting disk image..." 286 | MOUNT_DIR="/Volumes/${VOLUME_NAME}" 287 | 288 | # try unmount dmg if it was mounted previously (e.g. developer mounted dmg, installed app and forgot to unmount it) 289 | echo "Unmounting disk image..." 290 | DEV_NAME=$(hdiutil info | egrep --color=never '^/dev/' | sed 1q | awk '{print $1}') 291 | test -d "${MOUNT_DIR}" && hdiutil detach "${DEV_NAME}" 292 | 293 | echo "Mount directory: $MOUNT_DIR" 294 | DEV_NAME=$(hdiutil attach -readwrite -noverify -noautoopen "${DMG_TEMP_NAME}" | egrep --color=never '^/dev/' | sed 1q | awk '{print $1}') 295 | echo "Device name: $DEV_NAME" 296 | 297 | if ! test -z "$BACKGROUND_FILE"; then 298 | echo "Copying background file..." 299 | test -d "$MOUNT_DIR/.background" || mkdir "$MOUNT_DIR/.background" 300 | cp "$BACKGROUND_FILE" "$MOUNT_DIR/.background/$BACKGROUND_FILE_NAME" 301 | fi 302 | 303 | if ! test -z "$APPLICATION_LINK"; then 304 | echo "making link to Applications dir" 305 | echo $MOUNT_DIR 306 | ln -s /Applications "$MOUNT_DIR/Applications" 307 | fi 308 | 309 | if ! test -z "$QL_LINK"; then 310 | echo "making link to QuickLook install dir" 311 | echo $MOUNT_DIR 312 | ln -s "/Library/QuickLook" "$MOUNT_DIR/QuickLook" 313 | fi 314 | 315 | if ! test -z "$VOLUME_ICON_FILE"; then 316 | echo "Copying volume icon file '$VOLUME_ICON_FILE'..." 317 | cp "$VOLUME_ICON_FILE" "$MOUNT_DIR/.VolumeIcon.icns" 318 | SetFile -c icnC "$MOUNT_DIR/.VolumeIcon.icns" 319 | fi 320 | 321 | if ! test -z "$ADD_FILE_SOURCES"; then 322 | echo "Copying custom files..." 323 | for i in "${!ADD_FILE_SOURCES[@]}" 324 | do 325 | echo "${ADD_FILE_SOURCES[$i]}" 326 | cp -a "${ADD_FILE_SOURCES[$i]}" "$MOUNT_DIR/${ADD_FILE_TARGETS[$i]}" 327 | done 328 | fi 329 | 330 | if ! test -z "$ADD_FOLDER_SOURCES"; then 331 | echo "Copying custom folders..." 332 | for i in "${!ADD_FOLDER_SOURCES[@]}" 333 | do 334 | echo "${ADD_FOLDER_SOURCES[$i]}" 335 | cp -a "${ADD_FOLDER_SOURCES[$i]}" "$MOUNT_DIR/${ADD_FOLDER_TARGETS[$i]}" 336 | done 337 | fi 338 | 339 | # run applescript 340 | APPLESCRIPT=$(mktemp -t createdmg.tmp.XXXXXXXXXX) 341 | 342 | function applescript_source() { 343 | if [ $BREW_INSTALL -eq 0 ]; then 344 | cat "$AUX_PATH/template.applescript" 345 | else 346 | cat << 'EOS' 347 | # BREW_INLINE_APPLESCRIPT_PLACEHOLDER 348 | EOS 349 | fi 350 | } 351 | 352 | if [ $SKIP_JENKINS -eq 0 ]; then 353 | applescript_source | sed -e "s/WINX/$WINX/g" -e "s/WINY/$WINY/g" -e "s/WINW/$WINW/g" -e "s/WINH/$WINH/g" -e "s/BACKGROUND_CLAUSE/$BACKGROUND_CLAUSE/g" -e "s/REPOSITION_HIDDEN_FILES_CLAUSE/$REPOSITION_HIDDEN_FILES_CLAUSE/g" -e "s/ICON_SIZE/$ICON_SIZE/g" -e "s/TEXT_SIZE/$TEXT_SIZE/g" | perl -pe "s/POSITION_CLAUSE/$POSITION_CLAUSE/g" | perl -pe "s/QL_CLAUSE/$QL_CLAUSE/g" | perl -pe "s/APPLICATION_CLAUSE/$APPLICATION_CLAUSE/g" | perl -pe "s/HIDING_CLAUSE/$HIDING_CLAUSE/" >"$APPLESCRIPT" 354 | sleep 2 # pause to workaround occasional "Can’t get disk" (-1728) issues 355 | echo "Running Applescript: /usr/bin/osascript \"${APPLESCRIPT}\" \"${VOLUME_NAME}\"" 356 | (/usr/bin/osascript "${APPLESCRIPT}" "${VOLUME_NAME}" || if [[ "$?" -ne 0 ]]; then echo "Failed running AppleScript"; hdiutil detach "${DEV_NAME}"; exit 64; fi) 357 | echo "Done running the applescript..." 358 | sleep 4 359 | rm "$APPLESCRIPT" 360 | fi 361 | 362 | # make sure it's not world writeable 363 | echo "Fixing permissions..." 364 | chmod -Rf go-w "${MOUNT_DIR}" &> /dev/null || true 365 | echo "Done fixing permissions." 366 | 367 | # make the top window open itself on mount: 368 | if [ $SANDBOX_SAFE -eq 0 ]; then 369 | echo "Blessing started" 370 | bless --folder "${MOUNT_DIR}" 371 | echo "Blessing finished" 372 | echo "Opening directory" 373 | open "${MOUNT_DIR}" 374 | else 375 | echo "Skipping blessing on sandbox" 376 | fi 377 | 378 | if ! test -z "$VOLUME_ICON_FILE"; then 379 | # tell the volume that it has a special file attribute 380 | SetFile -a C "$MOUNT_DIR" 381 | fi 382 | 383 | # unmount 384 | echo "Unmounting disk image..." 385 | hdiutil detach "${DEV_NAME}" 386 | 387 | # compress image 388 | echo "Compressing disk image..." 389 | hdiutil convert ${HDIUTIL_VERBOSITY} "${DMG_TEMP_NAME}" -format ${FORMAT} ${IMAGEKEY} -o "${DMG_DIR}/${DMG_NAME}" 390 | rm -f "${DMG_TEMP_NAME}" 391 | 392 | # adding EULA resources 393 | if [ ! -z "${EULA_RSRC}" -a "${EULA_RSRC}" != "-null-" ]; then 394 | echo "adding EULA resources" 395 | 396 | REZ_ARG="" 397 | if [ ! -z "${REZ_PATH}" -a "${REZ_PATH}" != "-null-" ]; then 398 | REZ_ARG="--rez ${REZ_PATH}" 399 | fi 400 | if [ $BREW_INSTALL -eq 0 ]; then 401 | "${AUX_PATH}/dmg-license.py" "${DMG_DIR}/${DMG_NAME}" "${EULA_RSRC}" ${REZ_ARG} 402 | else 403 | python - "${DMG_DIR}/${DMG_NAME}" "${EULA_RSRC}" ${REZ_ARG} <<-'EOS' 404 | # BREW_INLINE_LICENSE_PLACEHOLDER 405 | EOS 406 | fi 407 | fi 408 | 409 | if [ ! -z "${NOINTERNET}" -a "${NOINTERNET}" == 1 ]; then 410 | echo "not setting 'internet-enable' on the dmg" 411 | else 412 | # check if hdiutil supports internet-enable 413 | # support was removed in macOS 10.15 414 | # https://github.com/andreyvit/create-dmg/issues/76 415 | if hdiutil internet-enable -help >/dev/null 2>/dev/null 416 | then 417 | hdiutil internet-enable -yes "${DMG_DIR}/${DMG_NAME}" 418 | else 419 | echo "hdiutil does not support internet-enable. Note it was removed in macOS 10.15." 420 | fi 421 | fi 422 | 423 | echo "Disk image done" 424 | exit 0 425 | -------------------------------------------------------------------------------- /vendor/create-dmg/sample: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Since create-dmg does not override, be sure to delete previous DMG 4 | test -f Application-Installer.dmg && rm Application-Installer.dmg 5 | 6 | # Create the DMG 7 | ./create-dmg \ 8 | --volname "Application Installer" \ 9 | --volicon "application\_icon.icns" \ 10 | --background "installer\_background.png" \ 11 | --window-pos 200 120 \ 12 | --window-size 800 400 \ 13 | --icon-size 100 \ 14 | --icon "Application.app" 200 190 \ 15 | --hide-extension "Application.app" \ 16 | --app-drop-link 600 185 \ 17 | "Application-Installer.dmg" \ 18 | "source_folder/" -------------------------------------------------------------------------------- /vendor/create-dmg/support/brew-me.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Bundle support scripts to main script 4 | 5 | cd "${0%/*}" 6 | 7 | script='../create-dmg' 8 | script_brew='../create-dmg-brew' 9 | applescript='template.applescript' 10 | licensescript='dmg-license.py' 11 | 12 | asl=$(awk "/BREW_INLINE_APPLESCRIPT_PLACEHOLDER/{ print NR; exit }" "$script") 13 | sed -n 1,$(( asl - 1 ))p "$script" | sed -e 's/BREW_INSTALL=0/BREW_INSTALL=1/g' > "$script_brew" 14 | cat "$applescript" >> "$script_brew" 15 | lsl=$(awk "/BREW_INLINE_LICENSE_PLACEHOLDER/{ print NR; exit }" "$script") 16 | sed -n $(( asl + 1 )),$(( lsl - 1 ))p "$script" >> "$script_brew" 17 | cat "$licensescript" | sed '1d' >> "$script_brew" 18 | sed -n $(( lsl + 1 )),\$p "$script" >> "$script_brew" 19 | 20 | mv "$script_brew" "$script" 21 | chmod +x "$script" 22 | -------------------------------------------------------------------------------- /vendor/create-dmg/support/dmg-license.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | """ 3 | This script adds a license file to a DMG. Requires Xcode and a plain ascii text 4 | license file. 5 | Obviously only runs on a Mac. 6 | 7 | Copyright (C) 2011-2013 Jared Hobbs 8 | 9 | Permission is hereby granted, free of charge, to any person obtaining a copy 10 | of this software and associated documentation files (the "Software"), to deal 11 | in the Software without restriction, including without limitation the rights 12 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 13 | copies of the Software, and to permit persons to whom the Software is 14 | furnished to do so, subject to the following conditions: 15 | 16 | The above copyright notice and this permission notice shall be included in 17 | all copies or substantial portions of the Software. 18 | 19 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 20 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 21 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 22 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 23 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 24 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 25 | THE SOFTWARE. 26 | """ 27 | from __future__ import print_function 28 | import os 29 | import sys 30 | import tempfile 31 | import optparse 32 | 33 | 34 | class Path(str): 35 | def __enter__(self): 36 | return self 37 | 38 | def __exit__(self, type, value, traceback): 39 | os.unlink(self) 40 | 41 | 42 | def mktemp(dir=None, suffix=''): 43 | (fd, filename) = tempfile.mkstemp(dir=dir, suffix=suffix) 44 | os.close(fd) 45 | return Path(filename) 46 | 47 | 48 | def main(options, args): 49 | dmgFile, license = args 50 | with mktemp('.') as tmpFile: 51 | with open(tmpFile, 'w') as f: 52 | f.write("""data 'TMPL' (128, "LPic") { 53 | $"1344 6566 6175 6C74 204C 616E 6775 6167" 54 | $"6520 4944 4457 5244 0543 6F75 6E74 4F43" 55 | $"4E54 042A 2A2A 2A4C 5354 430B 7379 7320" 56 | $"6C61 6E67 2049 4444 5752 441E 6C6F 6361" 57 | $"6C20 7265 7320 4944 2028 6F66 6673 6574" 58 | $"2066 726F 6D20 3530 3030 4457 5244 1032" 59 | $"2D62 7974 6520 6C61 6E67 7561 6765 3F44" 60 | $"5752 4404 2A2A 2A2A 4C53 5445" 61 | }; 62 | 63 | data 'LPic' (5000) { 64 | $"0000 0002 0000 0000 0000 0000 0004 0000" 65 | }; 66 | 67 | data 'STR#' (5000, "English buttons") { 68 | $"0006 0D45 6E67 6C69 7368 2074 6573 7431" 69 | $"0541 6772 6565 0844 6973 6167 7265 6505" 70 | $"5072 696E 7407 5361 7665 2E2E 2E7A 4966" 71 | $"2079 6F75 2061 6772 6565 2077 6974 6820" 72 | $"7468 6520 7465 726D 7320 6F66 2074 6869" 73 | $"7320 6C69 6365 6E73 652C 2063 6C69 636B" 74 | $"2022 4167 7265 6522 2074 6F20 6163 6365" 75 | $"7373 2074 6865 2073 6F66 7477 6172 652E" 76 | $"2020 4966 2079 6F75 2064 6F20 6E6F 7420" 77 | $"6167 7265 652C 2070 7265 7373 2022 4469" 78 | $"7361 6772 6565 2E22" 79 | }; 80 | 81 | data 'STR#' (5002, "English") { 82 | $"0006 0745 6E67 6C69 7368 0541 6772 6565" 83 | $"0844 6973 6167 7265 6505 5072 696E 7407" 84 | $"5361 7665 2E2E 2E7B 4966 2079 6F75 2061" 85 | $"6772 6565 2077 6974 6820 7468 6520 7465" 86 | $"726D 7320 6F66 2074 6869 7320 6C69 6365" 87 | $"6E73 652C 2070 7265 7373 2022 4167 7265" 88 | $"6522 2074 6F20 696E 7374 616C 6C20 7468" 89 | $"6520 736F 6674 7761 7265 2E20 2049 6620" 90 | $"796F 7520 646F 206E 6F74 2061 6772 6565" 91 | $"2C20 7072 6573 7320 2244 6973 6167 7265" 92 | $"6522 2E" 93 | };\n\n""") 94 | with open(license, 'r') as l: 95 | kind = 'RTF ' if license.lower().endswith('.rtf') else 'TEXT' 96 | f.write('data \'%s\' (5000, "English") {\n' % kind) 97 | def escape(s): 98 | return s.strip().replace('\\', '\\\\').replace('"', '\\"').replace('\0', '') 99 | 100 | for line in l: 101 | line = escape(line) 102 | for liner in [line[i:i+1000] for i in range(0, len(line), 1000)]: 103 | f.write(' "' + liner + '"\n') 104 | f.write(' "' + '\\n"\n') 105 | f.write('};\n\n') 106 | f.write("""data 'styl' (5000, "English") { 107 | $"0003 0000 0000 000C 0009 0014 0000 0000" 108 | $"0000 0000 0000 0000 0027 000C 0009 0014" 109 | $"0100 0000 0000 0000 0000 0000 002A 000C" 110 | $"0009 0014 0000 0000 0000 0000 0000" 111 | };\n""") 112 | os.system('hdiutil unflatten -quiet "%s"' % dmgFile) 113 | ret = os.system('%s -a %s -o "%s"' % 114 | (options.rez, tmpFile, dmgFile)) 115 | os.system('hdiutil flatten -quiet "%s"' % dmgFile) 116 | if options.compression is not None: 117 | os.system('cp %s %s.temp.dmg' % (dmgFile, dmgFile)) 118 | os.remove(dmgFile) 119 | if options.compression == "bz2": 120 | os.system('hdiutil convert %s.temp.dmg -format UDBZ -o %s' % 121 | (dmgFile, dmgFile)) 122 | elif options.compression == "gz": 123 | os.system('hdiutil convert %s.temp.dmg -format ' % dmgFile + 124 | 'UDZO -imagekey zlib-devel=9 -o %s' % dmgFile) 125 | os.remove('%s.temp.dmg' % dmgFile) 126 | if ret == 0: 127 | print("Successfully added license to '%s'" % dmgFile) 128 | else: 129 | print("Failed to add license to '%s'" % dmgFile) 130 | 131 | if __name__ == '__main__': 132 | parser = optparse.OptionParser() 133 | parser.set_usage("""%prog [OPTIONS] 134 | This program adds a software license agreement to a DMG file. 135 | It requires Xcode and either a plain ascii text 136 | or a with the RTF contents. 137 | 138 | See --help for more details.""") 139 | parser.add_option( 140 | '--rez', 141 | '-r', 142 | action='store', 143 | default='/Applications/Xcode.app/Contents/Developer/Tools/Rez', 144 | help='The path to the Rez tool. Defaults to %default' 145 | ) 146 | parser.add_option( 147 | '--compression', 148 | '-c', 149 | action='store', 150 | choices=['bz2', 'gz'], 151 | default=None, 152 | help='Optionally compress dmg using specified compression type. ' 153 | 'Choices are bz2 and gz.' 154 | ) 155 | options, args = parser.parse_args() 156 | cond = len(args) != 2 157 | if not os.path.exists(options.rez): 158 | print('Failed to find Rez at "%s"!\n' % options.rez) 159 | cond = True 160 | if cond: 161 | parser.print_usage() 162 | sys.exit(1) 163 | main(options, args) 164 | -------------------------------------------------------------------------------- /vendor/create-dmg/support/template.applescript: -------------------------------------------------------------------------------- 1 | on run (volumeName) 2 | tell application "Finder" 3 | tell disk (volumeName as string) 4 | open 5 | 6 | set theXOrigin to WINX 7 | set theYOrigin to WINY 8 | set theWidth to WINW 9 | set theHeight to WINH 10 | 11 | set theBottomRightX to (theXOrigin + theWidth) 12 | set theBottomRightY to (theYOrigin + theHeight) 13 | set dsStore to "\"" & "/Volumes/" & volumeName & "/" & ".DS_STORE\"" 14 | 15 | tell container window 16 | set current view to icon view 17 | set toolbar visible to false 18 | set statusbar visible to false 19 | set the bounds to {theXOrigin, theYOrigin, theBottomRightX, theBottomRightY} 20 | set statusbar visible to false 21 | REPOSITION_HIDDEN_FILES_CLAUSE 22 | end tell 23 | 24 | set opts to the icon view options of container window 25 | tell opts 26 | set icon size to ICON_SIZE 27 | set text size to TEXT_SIZE 28 | set arrangement to not arranged 29 | end tell 30 | BACKGROUND_CLAUSE 31 | 32 | -- Positioning 33 | POSITION_CLAUSE 34 | 35 | -- Hiding 36 | HIDING_CLAUSE 37 | 38 | -- Application and QL Link Clauses 39 | APPLICATION_CLAUSE 40 | QL_CLAUSE 41 | close 42 | open 43 | -- Force saving of the size 44 | delay 1 45 | 46 | tell container window 47 | set statusbar visible to false 48 | set the bounds to {theXOrigin, theYOrigin, theBottomRightX - 10, theBottomRightY - 10} 49 | end tell 50 | end tell 51 | 52 | delay 1 53 | 54 | tell disk (volumeName as string) 55 | tell container window 56 | set statusbar visible to false 57 | set the bounds to {theXOrigin, theYOrigin, theBottomRightX, theBottomRightY} 58 | end tell 59 | end tell 60 | 61 | --give the finder some time to write the .DS_Store file 62 | delay 3 63 | 64 | set waitTime to 0 65 | set ejectMe to false 66 | repeat while ejectMe is false 67 | delay 1 68 | set waitTime to waitTime + 1 69 | 70 | if (do shell script "[ -f " & dsStore & " ]; echo $?") = "0" then set ejectMe to true 71 | end repeat 72 | log "waited " & waitTime & " seconds for .DS_STORE to be created." 73 | end tell 74 | end run 75 | --------------------------------------------------------------------------------