Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix always fails to find "pubspec.lock" on Windows #4

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions bin/formats/about_libraries_format.dart
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,8 @@ class AboutLibrariesFormat extends FormatHoldable {
/// Write formated text to file.
@override
void write() async {
Map environmentVars = Platform.environment;
String directoryPath =
'${environmentVars["PWD"]}/android/app/src/main/res/values';
'${Directory.current.path}/android/app/src/main/res/values';
String fullPath = "$directoryPath/license_strings.xml";
await new Directory(directoryPath).create(recursive: true);
var output = """\
Expand Down
5 changes: 2 additions & 3 deletions bin/formats/settings_bundle_plist_format.dart
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,8 @@ class SettingsBundlePlistFormat extends FormatHoldable {
/// Write formated text to file.
@override
void write() async {
Map environmentVars = Platform.environment;
String directoryPath =
'${environmentVars["PWD"]}/ios/Runner/Settings.bundle';
'${Directory.current.path}/ios/Runner/Settings.bundle';
if (FileSystemEntity.typeSync(directoryPath) ==
FileSystemEntityType.notFound) {
throw AssertionError(
Expand Down Expand Up @@ -83,7 +82,7 @@ ${rootOutput.join("\n")}
doWrite(file, output);

String subDirectoryPath =
'${environmentVars["PWD"]}/ios/Runner/Settings.bundle/com.ko2ic.dart-oss-licenses';
'${Directory.current.path}/ios/Runner/Settings.bundle/com.ko2ic.dart-oss-licenses';
await new Directory(subDirectoryPath).create(recursive: true);

tuples.forEach((tuple) {
Expand Down
3 changes: 1 addition & 2 deletions bin/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,7 @@ main(List<String> arguments) async {

/// acquire all the names of the using library.
Iterable<dynamic> findPluginNames() {
Map environmentVars = Platform.environment;
String path = '${environmentVars["PWD"]}/pubspec.lock';
String path = '${Directory.current.path}/pubspec.lock';

if (FileSystemEntity.typeSync(path) == FileSystemEntityType.notFound) {
throw AssertionError(
Expand Down