OLD | NEW |
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 library update_homebrew; | 5 library update_homebrew; |
6 | 6 |
7 import 'dart:io'; | 7 import 'dart:io'; |
8 import 'dart:convert'; | 8 import 'dart:convert'; |
9 import 'dart:async'; | 9 import 'dart:async'; |
10 import 'package:http/http.dart' as http; | 10 import 'package:http/http.dart' as http; |
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
133 | 133 |
134 resource 'content_shell' do | 134 resource 'content_shell' do |
135 url '$urlBase/stable/release/${revisions['stable']}/$contentShellFile' | 135 url '$urlBase/stable/release/${revisions['stable']}/$contentShellFile' |
136 version '$stableVersion' | 136 version '$stableVersion' |
137 sha256 '${hashes['stable'][contentShellFile]}' | 137 sha256 '${hashes['stable'][contentShellFile]}' |
138 end | 138 end |
139 | 139 |
140 def shim_script target | 140 def shim_script target |
141 <<-EOS.undent | 141 <<-EOS.undent |
142 #!/bin/bash | 142 #!/bin/bash |
143 "#{prefix}/#{target}" "\$@" | 143 exec "#{prefix}/#{target}" "\$@" |
144 EOS | 144 EOS |
145 end | 145 end |
146 | 146 |
147 def install | 147 def install |
148 dartium_binary = 'Chromium.app/Contents/MacOS/Chromium' | 148 dartium_binary = 'Chromium.app/Contents/MacOS/Chromium' |
149 prefix.install Dir['*'] | 149 prefix.install Dir['*'] |
150 (bin+"dartium").write shim_script dartium_binary | 150 (bin+"dartium").write shim_script dartium_binary |
151 | 151 |
152 content_shell_binary = 'Content Shell.app/Contents/MacOS/Content Shell' | 152 content_shell_binary = 'Content Shell.app/Contents/MacOS/Content Shell' |
153 prefix.install resource('content_shell') | 153 prefix.install resource('content_shell') |
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
258 repository = tempDir.path; | 258 repository = tempDir.path; |
259 }) | 259 }) |
260 .then((_) => runGit( | 260 .then((_) => runGit( |
261 ['clone', 'git@github.com:dart-lang/homebrew-dart.git', '.'])) | 261 ['clone', 'git@github.com:dart-lang/homebrew-dart.git', '.'])) |
262 .then((_) => writeHomebrewInfo(channel, revision)) | 262 .then((_) => writeHomebrewInfo(channel, revision)) |
263 .then((_) => runGit(['commit', '-a', '-m', | 263 .then((_) => runGit(['commit', '-a', '-m', |
264 'Updated $channel branch to revision $revision'])) | 264 'Updated $channel branch to revision $revision'])) |
265 .then((_) => runGit(['push'])) | 265 .then((_) => runGit(['push'])) |
266 .whenComplete(() => new Directory(repository).delete(recursive: true)); | 266 .whenComplete(() => new Directory(repository).delete(recursive: true)); |
267 } | 267 } |
OLD | NEW |