13 lines
No EOL
332 B
Dart
13 lines
No EOL
332 B
Dart
import 'dart:io';
|
|
|
|
final RegExp _leadingSlashes = new RegExp(r'^/+');
|
|
|
|
|
|
String resolvePub() {
|
|
var exec = new File(Platform.resolvedExecutable);
|
|
var pubPath = exec.parent.uri.resolve('pub').path;
|
|
if (Platform.isWindows)
|
|
pubPath = pubPath.replaceAll(_leadingSlashes, '') + '.bat';
|
|
pubPath = Uri.decodeFull(pubPath);
|
|
return pubPath;
|
|
} |