From 18a99e1c398e517f7087a4364023e47402cd167e Mon Sep 17 00:00:00 2001 From: Thevakumar-Luheerathan Date: Wed, 15 Nov 2023 11:41:18 +0530 Subject: [PATCH 1/2] Remove outdated local repo dependency --- .../src/main/java/io/ballerina/cli/cmd/PushCommand.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cli/ballerina-cli/src/main/java/io/ballerina/cli/cmd/PushCommand.java b/cli/ballerina-cli/src/main/java/io/ballerina/cli/cmd/PushCommand.java index ff3ee3e9cc70..3c04bb5fb7e9 100644 --- a/cli/ballerina-cli/src/main/java/io/ballerina/cli/cmd/PushCommand.java +++ b/cli/ballerina-cli/src/main/java/io/ballerina/cli/cmd/PushCommand.java @@ -382,8 +382,8 @@ private void pushBalaToCustomRepo(Path balaFilePath) { Path balaCachesPath = repoPath.resolve(ProjectConstants.CACHES_DIR_NAME + "-" + ballerinaShortVersion) .resolve(org).resolve(packageName).resolve(version); try { - if (Files.exists(balaDestPath)) { - ProjectUtils.deleteDirectory(balaDestPath); + if (Files.exists(balaDestPath.getParent())) { + ProjectUtils.deleteDirectory(balaDestPath.getParent()); } if (Files.exists(balaCachesPath)) { ProjectUtils.deleteDirectory(balaCachesPath); From 21a32d4da477cd9f2b7919c285a3b4d485896a4f Mon Sep 17 00:00:00 2001 From: Thevakumar-Luheerathan Date: Thu, 23 Nov 2023 10:04:25 +0530 Subject: [PATCH 2/2] Fix checkstyle failure --- .../src/main/java/io/ballerina/cli/cmd/PushCommand.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/cli/ballerina-cli/src/main/java/io/ballerina/cli/cmd/PushCommand.java b/cli/ballerina-cli/src/main/java/io/ballerina/cli/cmd/PushCommand.java index 3c04bb5fb7e9..37aba77ce417 100644 --- a/cli/ballerina-cli/src/main/java/io/ballerina/cli/cmd/PushCommand.java +++ b/cli/ballerina-cli/src/main/java/io/ballerina/cli/cmd/PushCommand.java @@ -379,11 +379,13 @@ private void pushBalaToCustomRepo(Path balaFilePath) { Path balaDestPath = repoPath.resolve(ProjectConstants.BALA_DIR_NAME) .resolve(org).resolve(packageName).resolve(version).resolve(platform); + Path balaVersionPath = repoPath.resolve(ProjectConstants.BALA_DIR_NAME) + .resolve(org).resolve(packageName).resolve(version); Path balaCachesPath = repoPath.resolve(ProjectConstants.CACHES_DIR_NAME + "-" + ballerinaShortVersion) .resolve(org).resolve(packageName).resolve(version); try { - if (Files.exists(balaDestPath.getParent())) { - ProjectUtils.deleteDirectory(balaDestPath.getParent()); + if (Files.exists(balaVersionPath)) { + ProjectUtils.deleteDirectory(balaVersionPath); } if (Files.exists(balaCachesPath)) { ProjectUtils.deleteDirectory(balaCachesPath);