Skip to content

Commit

Permalink
Added new commands: 'odood venv npm' and 'odood venv python'
Browse files Browse the repository at this point in the history
  • Loading branch information
katyukha committed May 16, 2024
1 parent 19584d9 commit 8b0b30f
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 0 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
### Added

- New command `odood venv pip` that allows to run pip from current venv.
- New command `odood venv npm` that allows to run npm from current venv.
- New command `odood venv python` that allows to run python from current venv.


### Changed
Expand Down
36 changes: 36 additions & 0 deletions subpackages/cli/source/odood/cli/commands/venv.d
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,40 @@ class CommandVenvPIP: OdoodCommand {
}


class CommandVenvNPM: OdoodCommand {

this() {
super("npm", "Run npm for this environment. All arguments after '--' will be forwarded directly to npm.");
}

public override void execute(ProgramArgs args) {
auto project = Project.loadProject;
project.venv.runner
.addArgs("npm")
.addArgs(args.argsRest)
.execv;
}

}


class CommandVenvPython: OdoodCommand {

this() {
super("python", "Run python for this environment. All arguments after '--' will be forwarded directly to python.");
}

public override void execute(ProgramArgs args) {
auto project = Project.loadProject;
project.venv.runner
.addArgs("python")
.addArgs(args.argsRest)
.execv;
}

}


class CommandVenvReinstall: OdoodCommand {

this() {
Expand Down Expand Up @@ -205,6 +239,8 @@ class CommandVenv: OdoodCommand {
this.add(new CommandVenvUpdateOdoo());
this.add(new CommandVenvReinstallOdoo());
this.add(new CommandVenvPIP());
this.add(new CommandVenvNPM());
this.add(new CommandVenvPython());
}
}

Expand Down

0 comments on commit 8b0b30f

Please sign in to comment.