Skip to content

Commit

Permalink
Merge 230fd0f into f8b7c65
Browse files Browse the repository at this point in the history
  • Loading branch information
salimbouch authored Jun 17, 2024
2 parents f8b7c65 + 230fd0f commit 487aa4b
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import com.devonfw.tools.ide.context.GitContext;
import com.devonfw.tools.ide.context.IdeContext;
import com.devonfw.tools.ide.property.FlagProperty;
import com.devonfw.tools.ide.property.StringProperty;
import com.devonfw.tools.ide.repo.CustomTool;
import com.devonfw.tools.ide.step.Step;
Expand All @@ -23,6 +24,9 @@ public abstract class AbstractUpdateCommandlet extends Commandlet {
/** {@link StringProperty} for the settings repository URL. */
protected final StringProperty settingsRepo;

/** {@link FlagProperty} for skipping installation/updating of tools */
protected final FlagProperty skipTools;

/**
* The constructor.
*
Expand All @@ -32,6 +36,7 @@ public AbstractUpdateCommandlet(IdeContext context) {

super(context);
this.settingsRepo = new StringProperty("", false, "settingsRepository");
this.skipTools = new FlagProperty("--skip-tools", false, null);
}

@Override
Expand All @@ -57,7 +62,12 @@ public void run() {
} finally {
step.end();
}
updateSoftware();

if (skipTools.isTrue()) {
this.context.info("Skipping installation/update of tools as specified by the user.");
} else {
updateSoftware();
}
}

private void setupConf(Path template, Path conf) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import com.devonfw.tools.ide.context.IdeContext;
import com.devonfw.tools.ide.io.FileAccess;
import com.devonfw.tools.ide.property.FlagProperty;
import com.devonfw.tools.ide.property.StringProperty;

import java.nio.file.Path;
Expand All @@ -11,8 +12,12 @@
*/
public class CreateCommandlet extends AbstractUpdateCommandlet {

/** {@link StringProperty} for the name of the new project */
public final StringProperty newProject;

/** {@link FlagProperty} for skipping the setup of git repositories */
public final FlagProperty skipRepositories;

/**
* The constructor.
*
Expand All @@ -24,6 +29,8 @@ public CreateCommandlet(IdeContext context) {
addKeyword(getName());
newProject = add(new StringProperty("", true, "project"));
add(this.settingsRepo);
this.skipRepositories = add(new FlagProperty("--skip-repositories", false, "skipRepositories"));
add(this.skipTools);
}

@Override
Expand Down Expand Up @@ -54,7 +61,11 @@ public void run() {
initializeProject(newProjectPath);
this.context.setIdeHome(newProjectPath);
super.run();
updateRepositories();
if (this.skipRepositories.isTrue()) {
this.context.info("Skipping the cloning of project repositories as specified by the user.");
} else {
updateRepositories();
}
this.context.success("Successfully created new project '{}'.", newProjectName);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ public UpdateCommandlet(IdeContext context) {

super(context);
addKeyword(getName());
add(this.skipTools);
}

@Override
Expand Down
2 changes: 2 additions & 0 deletions cli/src/main/resources/nls/Help.properties
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@ opt.--force=enable force mode.
opt.--locale=the locale (e.g. '--locale=de' for German language).
opt.--offline=enable offline mode (skip updates or git pull, fail downloads or git clone).
opt.--quiet=disable info logging (only log success, warning or error).
opt.--skip-repositories=skip the setup of repositories.
opt.--skip-tools=skip the installation/update of tools.
opt.--trace=enable trace logging.
opt.--version=Print the IDE version and exit.
options=Options:
Expand Down
2 changes: 2 additions & 0 deletions cli/src/main/resources/nls/Help_de.properties
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@ opt.--force=Aktiviert den Force-Modus (Erzwingen).
opt.--locale=Die Spracheinstellungen (z.B. 'en' für Englisch).
opt.--offline=Aktiviert den Offline-Modus (Überspringt Aktualisierungen oder git pull, schlägt fehl bei Downloads or git clone).
opt.--quiet=Deaktiviert Info Logging ( nur success, warning und error).
opt.--skip-repositories=überspringt die Einrichtung der Repositories.
opt.--skip-tools=überspringt die Installation/Aktualisierung der Tools.
opt.--trace=Aktiviert Trace-Ausgaben (detaillierte Fehleranalyse).
opt.--version=Zeigt die IDE Version an und beendet das Programm.
options=Optionen:
Expand Down

0 comments on commit 487aa4b

Please sign in to comment.