Skip to content

Commit

Permalink
GitHub PR#255 Fall back to using the process PWD in case PWD is not set
Browse files Browse the repository at this point in the history
--
69bb8b2 by maleo <[email protected]>:

Fall back to using the process PWD in case PWD is not set

Closes google#255

GitOrigin-RevId: 39c7f67
Change-Id: Ibca86f7104325bcd68d6492de868008d7aad2806
  • Loading branch information
mering authored and mikelalcon committed Sep 12, 2023
1 parent efe1714 commit 4c4715d
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 9 deletions.
4 changes: 2 additions & 2 deletions java/com/google/copybara/GeneralOptions.java
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ public boolean isVersionSelectorUseCliRef() {
* Returns current working directory
*/
public Path getCwd() {
return fileSystem.getPath(environment.get("PWD"));
return fileSystem.getPath(environment.getOrDefault("PWD", System.getProperty("user.dir")));
}

/**
Expand Down Expand Up @@ -555,4 +555,4 @@ public StarlarkMode getStarlarkMode() {
public boolean allowEmptyDiff(boolean configAllowEmptyDiff) {
return this.allowEmptyDiff == null ? configAllowEmptyDiff : this.allowEmptyDiff;
}
}
}
7 changes: 3 additions & 4 deletions repositories.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ def copybara_repositories():
# sha256 = RULES_JVM_EXTERNAL_SHA,
strip_prefix = "rules_jvm_external-%s" % RULES_JVM_EXTERNAL_TAG,
url = "https://github.com/bazelbuild/rules_jvm_external/archive/%s.zip" % RULES_JVM_EXTERNAL_TAG,
patches = ["@io_bazel//third_party:rules_jvm_external_5.2.patch"],
patch_args= ["-p1"],
patches = ["@io_bazel//third_party:rules_jvm_external_5.2.patch"],
patch_args = ["-p1"],
)

# LICENSE: The Apache Software License, Version 2.0
Expand Down Expand Up @@ -172,7 +172,7 @@ def copybara_repositories():
"https://github.com/bazelbuild/bazel-gazelle/releases/download/v0.29.0/bazel-gazelle-v0.29.0.tar.gz",
],
)

# LICENSE: The Apache Software License, Version 2.0
maybe(
http_archive,
Expand All @@ -183,4 +183,3 @@ def copybara_repositories():
],
build_file = Label("//external/third_party:jcommander.BUILD"),
)

1 change: 0 additions & 1 deletion third_party/bazel.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
# See the License for the specific language governing permissions and
# limitations under the License.


# This file is autogenerated by copybara, please do not edit.

bazel_version = "9e7aa139ae33376cf1ccab205dda6608967f56bd"
Expand Down
1 change: 0 additions & 1 deletion third_party/bazel_buildtools.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
# See the License for the specific language governing permissions and
# limitations under the License.


# This file is autogenerated by copybara, please do not edit.

buildtools_version = "046e1686ec6f0c37ab589d09dc18bfea66f98005"
Expand Down
1 change: 0 additions & 1 deletion third_party/bazel_skylib.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
# See the License for the specific language governing permissions and
# limitations under the License.


# This file is autogenerated by copybara, please do not edit.

skylib_version = "0171c69e5cc691e2d0cd9f3f3e4c3bf112370ca2"
Expand Down

0 comments on commit 4c4715d

Please sign in to comment.