Skip to content

Fix #677 Error if project is in OneDrive #680

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

Merged
merged 14 commits into from
Nov 3, 2023
Merged
Show file tree
Hide file tree
Changes from 2 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
9 changes: 9 additions & 0 deletions src/main/java/edu/wpi/first/gradlerio/GradleRIOPlugin.java
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
import edu.wpi.first.gradlerio.deploy.FRCDeployPlugin;
import edu.wpi.first.gradlerio.deploy.roborio.RoboRIO;
import edu.wpi.first.gradlerio.wpi.WPIPlugin;
import edu.wpi.first.gradlerio.OneDriveException;

public abstract class GradleRIOPlugin implements Plugin<Project> {

Expand All @@ -56,6 +57,14 @@ interface Parameters extends FlowParameters {
@Override
public void execute(Parameters parameters) {
Optional<Throwable> failure = parameters.getBuildResult().get().getFailure();
try {
if (System.getProperty("user.dir").contains("OneDrive")) {
throw new OneDriveException();
}
} catch(OneDriveException e) {

}

if (failure.isPresent()) {
try {
checkBuildFailed(failure.get());
Expand Down
14 changes: 14 additions & 0 deletions src/main/java/edu/wpi/first/gradlerio/OneDriveException.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
package edu.wpi.first.gradlerio;

import java.lang.Exception;

public class OneDriveException extends java.lang.Exception {
public OneDriveException() {
super(String.format("Error cannot create project inside OneDrive. Project Directory = %S", System.getProperty("user.dir")));
}

public void PrintMessage() {
System.out.println(String.format("Error cannot create project inside OneDrive. Project Directory = %S", System.getProperty("user.dir")));
}

}