Skip to content

Commit

Permalink
Merge pull request #112 from poshi1865/bug-auto-download-broken-111
Browse files Browse the repository at this point in the history
Bug auto download broken #111
  • Loading branch information
SaptarshiSarkar12 authored Oct 11, 2022
2 parents 5965cbe + 8b8facf commit 4ccb2ca
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/Drifty_CLI.java
Original file line number Diff line number Diff line change
Expand Up @@ -156,8 +156,14 @@ private static void enterDownloadsFolder(){
private static void saveToDefault(){
System.out.println("Trying to auto-detect default Downloads folder...");
logger.log("INFO", "Trying to auto-detect default Downloads folder...");
downloadsFolder = DefaultDownloadFolderLocationFinder.findPath() + System.getProperty("file.separator");
if (downloadsFolder.equals(System.getProperty("file.separator"))) {
if (!System.getProperty("os.name").contains("Windows")) {
String home = System.getProperty("user.home");
downloadsFolder = home + "/Downloads/";
}
else {
downloadsFolder = DefaultDownloadFolderLocationFinder.findPath() + System.getProperty("file.separator");
}
if (downloadsFolder.equals(System.getProperty("file.separator")) || downloadsFolder.equals(null)) {
System.out.println("Failed to retrieve default download folder!");
logger.log("ERROR", "Failed to retrieve default download folder!");
enterDownloadsFolder();
Expand Down

0 comments on commit 4ccb2ca

Please sign in to comment.