create container

This commit is contained in:
stubbfelnewpc
2020-07-07 22:35:17 +02:00
parent ffbb5ce424
commit 13b50650fa
3 changed files with 71 additions and 37 deletions

View File

@@ -33,7 +33,7 @@ const CLEAN_RUN_ARGUMENT_NAME: &str = "clean-run";
const VERBOSE_ARGUMENT_NAME: &str = "verbose";
const IDE_ID_ARGUMENT_NAME: &str = "ide-id";
fn main() {
fn main() {
let start_ide_file_arg =Arg::with_name(START_FILE_ARGUMENT_NAME)
.short("s")
@@ -50,7 +50,7 @@ fn main() {
.default_value("{}")
.takes_value(true);
let matches =
let matches =
App::new("nixidectl")
.version("0.1.0")
.author("stubbfel")
@@ -59,11 +59,11 @@ fn main() {
.arg(&start_ide_file_arg)
.arg(&start_ide_arguments_args)
.arg(Arg::with_name(CLEAN_RUN_ARGUMENT_NAME)
.short("c")
.short("c")
.long("clean-run")
.help("clean app folder, before start runnnig"))
.arg(Arg::with_name(VERBOSE_ARGUMENT_NAME)
.short("v")
.short("v")
.long("verbose")
.help("verbose")))
.subcommand(SubCommand::with_name(STOP_SUBCOMMAND_NAME)
@@ -90,7 +90,7 @@ fn main() {
.help("the name of the ide serive")
.default_value("nixide")
.takes_value(true)
.global(true))
.global(true))
.subcommand(SubCommand::with_name(INSTALL_SUBCOMMAND_NAME)
.arg(&start_ide_file_arg)
.arg(&start_ide_arguments_args)
@@ -111,7 +111,7 @@ fn main() {
_ => "run_ide.sh"
};
let nix_expression = format!("with import <nixpkgs> {{}}; callPackage {} {}", file, args);
let nix_expression = format!("with import <nixpkgs> {{}}; callPackage {} {}", file, args);
let cmd = Command::new("nix-shell")
.stderr(Stdio::null())
//.stdout(Stdio::null())
@@ -123,7 +123,7 @@ fn main() {
.arg(run_script)
.spawn()
.expect("start ide command failed");
let out = cmd.stdout.ok_or_else(|| Error::new(ErrorKind::Other,"Could not capture standard output.")).unwrap();
let reader = BufReader::new(out);
let start_up_log = reader.lines()