Skip to content

Commit

Permalink
fix jbang edit [patch]
Browse files Browse the repository at this point in the history
  • Loading branch information
maxandersen committed Aug 27, 2020
1 parent 406b208 commit fb61a6f
Show file tree
Hide file tree
Showing 5 changed files with 57 additions and 5 deletions.
8 changes: 8 additions & 0 deletions itests/edit.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
Feature: edit

Scenario: edit a file should print to std out
* command('jbang init hello.java')
* command('jbang edit hello.java')
* match err == ''
* match out contains '/'

2 changes: 1 addition & 1 deletion misc/updatesdkman.sh
Original file line number Diff line number Diff line change
Expand Up @@ -35,5 +35,5 @@ curl -X POST \
-H "Consumer-Token: ${SDKMAN_CONSUMER_TOKEN}" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-d '{"text": "Jbang '${jbang_version}' released on SDKMAN! Checkout https://github.com/jbangdev/jbang/releases/tag/v'${jbang_version}'. Follow @jbangdev #jbang"}' \
-d '{"text": "Jbang '${jbang_version}' Checkout https://github.com/jbangdev/jbang/releases/tag/v'${jbang_version}'. Follow @jbangdev."}' \
https://vendors.sdkman.io/announce/freeform
4 changes: 0 additions & 4 deletions src/main/java/dev/jbang/Main.java
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
package dev.jbang;

import java.io.FileDescriptor;
import java.io.FileOutputStream;
import java.io.PrintStream;
import java.util.ArrayList;
import java.util.List;

Expand All @@ -12,7 +9,6 @@

public class Main {
public static void main(String... args) {
System.setOut(new PrintStream(new FileOutputStream(FileDescriptor.err)));
CommandLine cli = Jbang.getCommandLine();
args = handleDefaultRun(cli.getCommandSpec(), args);
int exitcode = cli.execute(args);
Expand Down
18 changes: 18 additions & 0 deletions src/main/resources/init-qcli.java.qute
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
//usr/bin/env jbang "$0" "$@" ; exit $?

//DEPS io.quarkus:quarkus-resteasy:999-SNAPSHOT
//DEPS io.quarkus:quarkus-smallrye-openapi:999-SNAPSHOT
// Comment out below to have swagger-ui available at /swagger-ui
// //DEPS io.quarkus:quarkus-swagger-ui:999-SNAPSHOT
// //CONFIG quarkus.swagger-ui.always-include=true
import io.quarkus.runtime.QuarkusApplication;
import io.quarkus.runtime.annotations.QuarkusMain;

@QuarkusMain
public class HelloWorldMain implements QuarkusApplication {
@Override
public int run(String... args) throws Exception {
System.out.println("Hello World");
return 10;
}
}
30 changes: 30 additions & 0 deletions src/main/resources/init-qrest.java.qute
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
//usr/bin/env jbang "$0" "$@" ; exit $?

//DEPS io.quarkus:quarkus-resteasy:999-SNAPSHOT
//DEPS io.quarkus:quarkus-smallrye-openapi:999-SNAPSHOT
// Comment out below to have swagger-ui available at /swagger-ui
// //DEPS io.quarkus:quarkus-swagger-ui:999-SNAPSHOT
// //CONFIG quarkus.swagger-ui.always-include=true

import io.quarkus.runtime.Quarkus;
import io.quarkus.runtime.QuarkusApplication;

import javax.ws.rs.GET;
import javax.ws.rs.Path;

import static java.lang.System.*;
import javax.ws.rs.GET;
import javax.ws.rs.Path;
@Path("/hello")
public class {baseName} {

public static void main(String... args) {
Quarkus.run(args);
}

@GET
public String sayHello() {
return "hello from Quarkus with jbang.dev";
}

}

0 comments on commit fb61a6f

Please sign in to comment.