Skip to content

Commit

Permalink
migrating profiles between buildtools is now possible (#56)
Browse files Browse the repository at this point in the history
migrating a profile will delete persistence in the old buildtool.

Signed-off-by: Noam Dori <TheNODO55@gmail.com>
  • Loading branch information
Noam-Dori committed Jun 23, 2021
1 parent d997ca7 commit c1fb5e9
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -161,10 +161,14 @@ public void removeProfile(@NotNull ROSProfile profile) throws IOException {
/**
* update or add a new profile
* @param oldProfile the old profile to change. Set to null if you are adding a new profile.
* @param newProfile the new data of this profile (or the new profile)
* @param newProfile the new data of this profile (or the new profile). This profile should not run the "save" operation.
* @throws IOException if the write action could not be completed.
*/
public void updateProfile(@Nullable ROSProfile oldProfile, @NotNull ROSProfile newProfile) throws IOException {
ROSBuildTool oldBuildTool = oldProfile == null ? null : oldProfile.getBuildtool();
if (oldBuildTool != null && oldBuildTool != newProfile.getGuiBuildtool()) {
removeProfile(oldProfile); // this runs if we are migrating a profile
}
if (newProfile.getGuiBuildtool() == ROSBuildTool.CATKIN_TOOLS) {
VirtualFile profilesDir = FILE_SYSTEM.findFileByPath(settings.getWorkspacePath() + "/.catkin_tools/profiles");
if (profilesDir == null) {
Expand Down

0 comments on commit c1fb5e9

Please sign in to comment.