Skip to content
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

feat(cli): integrate sails-js-cli into sails-cli #523

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

osipov-mit
Copy link
Member

No description provided.

@@ -12,6 +12,26 @@ struct CargoCommands {
enum SailsCommands {
#[command(name = "sails", subcommand)]
Sails(Commands),
#[command(name = "sails-js", subcommand)]
SailsJs(JsCommands),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That won't work.
Only one command sails per cargo-sails executable.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1

#[derive(Subcommand)]
enum JsCommands {
#[command(name = "generate-client")]
GenerateClient {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it is better to make js-client under sails, like

cargo sails js-client service.idl

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1

Comment on lines +38 to +43
.expect("Failed to run npx sails-js-cli");

let status = child.wait().expect("An error occured");

if !status.success() {
panic!("Failed to generate JS client");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please instead of using panic, expect, etc., use Result to return the error s it can printed out by the program in standard way. This comment is applicable to the entire mod

}
}

pub fn check_app_installed(app: &str) -> bool {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Doesn't need to be pub

.unwrap_or(false)
}

pub fn check_node() -> Result<()> {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Doesn't need to be pub

Ok(())
}

pub fn check_npx() -> Result<()> {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Doesn't need to be pub

@@ -12,6 +12,26 @@ struct CargoCommands {
enum SailsCommands {
#[command(name = "sails", subcommand)]
Sails(Commands),
#[command(name = "sails-js", subcommand)]
SailsJs(JsCommands),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1

#[derive(Subcommand)]
enum JsCommands {
#[command(name = "generate-client")]
GenerateClient {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants