From 1da6ac8de7d9b851b56ef99ef94cf2d98b82a659 Mon Sep 17 00:00:00 2001 From: Blurryface05 Date: Fri, 27 Sep 2019 23:01:34 +0000 Subject: [PATCH 01/17] i new file: .gitpod.Dockerfile new file: .gitpod.yml --- .gitpod.Dockerfile | 12 ++++++++++++ .gitpod.yml | 11 +++++++++++ 2 files changed, 23 insertions(+) create mode 100644 .gitpod.Dockerfile create mode 100644 .gitpod.yml diff --git a/.gitpod.Dockerfile b/.gitpod.Dockerfile new file mode 100644 index 0000000000..b795e6cac7 --- /dev/null +++ b/.gitpod.Dockerfile @@ -0,0 +1,12 @@ +FROM gitpod/workspace-full + +USER root + +# Install custom tools, runtime, etc. using apt-get +# For example, the command below would install "bastet" - a command line tetris clone: +# +# RUN apt-get update \ +# && apt-get install -y bastet \ +# && apt-get clean && rm -rf /var/cache/apt/* && rm -rf /var/lib/apt/lists/* && rm -rf /tmp/* +# +# More information: https://www.gitpod.io/docs/42_config_docker/ diff --git a/.gitpod.yml b/.gitpod.yml new file mode 100644 index 0000000000..87dd64a333 --- /dev/null +++ b/.gitpod.yml @@ -0,0 +1,11 @@ +image: + file: docker/Dockerfile + +# List the ports you want to expose and what to do when they are served. See https://www.gitpod.io/docs/43_config_ports/ +ports: +- port: 3000 + +# List the start up tasks. You can start them in parallel in multiple terminals. See https://www.gitpod.io/docs/44_config_start_tasks/ +tasks: +- init: echo 'init script' # runs during prebuild + command: echo 'start script' From ba778eaff91071b6be5d12f7ed2860d10d27d1de Mon Sep 17 00:00:00 2001 From: Blurryface05 Date: Sat, 28 Sep 2019 00:31:16 +0000 Subject: [PATCH 02/17] modified: docker/Dockerfile --- docker/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker/Dockerfile b/docker/Dockerfile index ffb1e5377d..e38096b7cf 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -1,6 +1,6 @@ ARG FROMTAG=latest FROM quay.io/nushell/nu-base:${FROMTAG} as base -FROM ubuntu:18.04 +FROM gitpod/workspace-full COPY --from=base /usr/local/bin/nu /usr/local/bin/nu ENV DEBIAN_FRONTEND noninteractive RUN apt-get update && apt-get install -y libssl-dev \ From f7d5ddbc07eb6c52ea9d8b780f4e47c76c4a3763 Mon Sep 17 00:00:00 2001 From: Sean Hellum Date: Fri, 27 Sep 2019 19:47:28 -0500 Subject: [PATCH 03/17] Update Dockerfile --- docker/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker/Dockerfile b/docker/Dockerfile index e38096b7cf..ffb1e5377d 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -1,6 +1,6 @@ ARG FROMTAG=latest FROM quay.io/nushell/nu-base:${FROMTAG} as base -FROM gitpod/workspace-full +FROM ubuntu:18.04 COPY --from=base /usr/local/bin/nu /usr/local/bin/nu ENV DEBIAN_FRONTEND noninteractive RUN apt-get update && apt-get install -y libssl-dev \ From 6617731d5bdd299b9047ac0b0a6f48c8fce27b3f Mon Sep 17 00:00:00 2001 From: Sean Hellum Date: Fri, 27 Sep 2019 19:51:42 -0500 Subject: [PATCH 04/17] Update .gitpod.Dockerfile --- .gitpod.Dockerfile | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/.gitpod.Dockerfile b/.gitpod.Dockerfile index b795e6cac7..30258b27be 100644 --- a/.gitpod.Dockerfile +++ b/.gitpod.Dockerfile @@ -1,12 +1,15 @@ FROM gitpod/workspace-full USER root - -# Install custom tools, runtime, etc. using apt-get -# For example, the command below would install "bastet" - a command line tetris clone: -# -# RUN apt-get update \ -# && apt-get install -y bastet \ -# && apt-get clean && rm -rf /var/cache/apt/* && rm -rf /var/lib/apt/lists/* && rm -rf /tmp/* -# -# More information: https://www.gitpod.io/docs/42_config_docker/ +RUN apt-get update && apt-get install -y libssl-dev \ + libxcb-composite0-dev \ + pkg-config \ + curl +RUN curl https://sh.rustup.rs -sSf | sh -s -- -y --no-modify-path --default-toolchain `cat rust-toolchain` +RUN echo "##vso[task.prependpath]/root/.cargo/bin" && \ + rustc -Vv && \ + if $RELEASE; then cargo build --release && cargo run --release; \ + cp target/release/nu /usr/local/bin; \ + else cargo build; \ + cp target/debug/nu /usr/local/bin; fi; +RUN cargo build From ac116f4f7cef51e9219da15fb1005cff5e3ff5cc Mon Sep 17 00:00:00 2001 From: Sean Hellum Date: Fri, 27 Sep 2019 19:54:05 -0500 Subject: [PATCH 05/17] Update .gitpod.yml --- .gitpod.yml | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/.gitpod.yml b/.gitpod.yml index 87dd64a333..3cce5cbf76 100644 --- a/.gitpod.yml +++ b/.gitpod.yml @@ -1,11 +1,2 @@ image: - file: docker/Dockerfile - -# List the ports you want to expose and what to do when they are served. See https://www.gitpod.io/docs/43_config_ports/ -ports: -- port: 3000 - -# List the start up tasks. You can start them in parallel in multiple terminals. See https://www.gitpod.io/docs/44_config_start_tasks/ -tasks: -- init: echo 'init script' # runs during prebuild - command: echo 'start script' + file: .gitpod.dockerfile From 12f34cc698dc626241dedc43aa5615fdcf3c8e8c Mon Sep 17 00:00:00 2001 From: Sean Hellum Date: Fri, 27 Sep 2019 19:54:42 -0500 Subject: [PATCH 06/17] Update .gitpod.yml --- .gitpod.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitpod.yml b/.gitpod.yml index 3cce5cbf76..527c76d392 100644 --- a/.gitpod.yml +++ b/.gitpod.yml @@ -1,2 +1,2 @@ image: - file: .gitpod.dockerfile + file: .gitpod.Dockerfile From 5b5c33a86f7e49a9e3d0dda4e90b93dcf55221ea Mon Sep 17 00:00:00 2001 From: Sean Hellum Date: Fri, 27 Sep 2019 19:58:36 -0500 Subject: [PATCH 07/17] Update .gitpod.Dockerfile --- .gitpod.Dockerfile | 1 - 1 file changed, 1 deletion(-) diff --git a/.gitpod.Dockerfile b/.gitpod.Dockerfile index 30258b27be..ac88719d72 100644 --- a/.gitpod.Dockerfile +++ b/.gitpod.Dockerfile @@ -5,7 +5,6 @@ RUN apt-get update && apt-get install -y libssl-dev \ libxcb-composite0-dev \ pkg-config \ curl -RUN curl https://sh.rustup.rs -sSf | sh -s -- -y --no-modify-path --default-toolchain `cat rust-toolchain` RUN echo "##vso[task.prependpath]/root/.cargo/bin" && \ rustc -Vv && \ if $RELEASE; then cargo build --release && cargo run --release; \ From 0d076d97be3c2ca873225fa750065f0b915d87e2 Mon Sep 17 00:00:00 2001 From: Sean Hellum Date: Fri, 27 Sep 2019 19:59:30 -0500 Subject: [PATCH 08/17] Update .gitpod.Dockerfile --- .gitpod.Dockerfile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.gitpod.Dockerfile b/.gitpod.Dockerfile index ac88719d72..792525b19a 100644 --- a/.gitpod.Dockerfile +++ b/.gitpod.Dockerfile @@ -4,7 +4,8 @@ USER root RUN apt-get update && apt-get install -y libssl-dev \ libxcb-composite0-dev \ pkg-config \ - curl + curl \ + rustc RUN echo "##vso[task.prependpath]/root/.cargo/bin" && \ rustc -Vv && \ if $RELEASE; then cargo build --release && cargo run --release; \ From 0d8768b82705d07cbc83125f33a94ce691dabecf Mon Sep 17 00:00:00 2001 From: Sean Hellum Date: Fri, 27 Sep 2019 20:01:50 -0500 Subject: [PATCH 09/17] Update .gitpod.Dockerfile --- .gitpod.Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitpod.Dockerfile b/.gitpod.Dockerfile index 792525b19a..73ca6c0b7f 100644 --- a/.gitpod.Dockerfile +++ b/.gitpod.Dockerfile @@ -1,5 +1,5 @@ FROM gitpod/workspace-full - +WORKDIR /workspace/nushell USER root RUN apt-get update && apt-get install -y libssl-dev \ libxcb-composite0-dev \ From aa495f4d743dcfdb0ba5f64195cb89f45c0abeaa Mon Sep 17 00:00:00 2001 From: Sean Hellum Date: Fri, 27 Sep 2019 20:04:24 -0500 Subject: [PATCH 10/17] Update .gitpod.Dockerfile --- .gitpod.Dockerfile | 6 ------ 1 file changed, 6 deletions(-) diff --git a/.gitpod.Dockerfile b/.gitpod.Dockerfile index 73ca6c0b7f..eaccc4be74 100644 --- a/.gitpod.Dockerfile +++ b/.gitpod.Dockerfile @@ -6,10 +6,4 @@ RUN apt-get update && apt-get install -y libssl-dev \ pkg-config \ curl \ rustc -RUN echo "##vso[task.prependpath]/root/.cargo/bin" && \ - rustc -Vv && \ - if $RELEASE; then cargo build --release && cargo run --release; \ - cp target/release/nu /usr/local/bin; \ - else cargo build; \ - cp target/debug/nu /usr/local/bin; fi; RUN cargo build From 48cbc5b23c4f0143519953cc2facf88a1a92ea88 Mon Sep 17 00:00:00 2001 From: Sean Hellum Date: Fri, 27 Sep 2019 20:06:15 -0500 Subject: [PATCH 11/17] Update .gitpod.Dockerfile --- .gitpod.Dockerfile | 1 - 1 file changed, 1 deletion(-) diff --git a/.gitpod.Dockerfile b/.gitpod.Dockerfile index eaccc4be74..e7732651ed 100644 --- a/.gitpod.Dockerfile +++ b/.gitpod.Dockerfile @@ -6,4 +6,3 @@ RUN apt-get update && apt-get install -y libssl-dev \ pkg-config \ curl \ rustc -RUN cargo build From 9f352ace23beda5af7977e6db57a44d02efd578d Mon Sep 17 00:00:00 2001 From: Sean Hellum Date: Fri, 27 Sep 2019 20:08:05 -0500 Subject: [PATCH 12/17] Update .gitpod.Dockerfile --- .gitpod.Dockerfile | 1 - 1 file changed, 1 deletion(-) diff --git a/.gitpod.Dockerfile b/.gitpod.Dockerfile index e7732651ed..b832017f62 100644 --- a/.gitpod.Dockerfile +++ b/.gitpod.Dockerfile @@ -1,5 +1,4 @@ FROM gitpod/workspace-full -WORKDIR /workspace/nushell USER root RUN apt-get update && apt-get install -y libssl-dev \ libxcb-composite0-dev \ From 20de0ea01f504a39c8805bf5d0ac43d2791fc3f8 Mon Sep 17 00:00:00 2001 From: Sean Hellum Date: Fri, 27 Sep 2019 20:09:21 -0500 Subject: [PATCH 13/17] Update .gitpod.yml --- .gitpod.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.gitpod.yml b/.gitpod.yml index 527c76d392..8adf00be3d 100644 --- a/.gitpod.yml +++ b/.gitpod.yml @@ -1,2 +1,4 @@ image: file: .gitpod.Dockerfile +tasks: + - command: cargo build From 6f6d2abdacf5c5b77e7568bb6fbc3da3de173e4d Mon Sep 17 00:00:00 2001 From: Blurryface05 Date: Sat, 28 Sep 2019 01:18:00 +0000 Subject: [PATCH 14/17] modified: .gitpod.yml --- .gitpod.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitpod.yml b/.gitpod.yml index 8adf00be3d..aab5b5cb5f 100644 --- a/.gitpod.yml +++ b/.gitpod.yml @@ -1,4 +1,4 @@ image: file: .gitpod.Dockerfile tasks: - - command: cargo build + - init: cargo build From b4c783f23d3fc86d70d42ebb815b0db0121eddff Mon Sep 17 00:00:00 2001 From: Blurryface05 Date: Sat, 28 Sep 2019 01:18:55 +0000 Subject: [PATCH 15/17] modified: .gitpod.yml --- .gitpod.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitpod.yml b/.gitpod.yml index aab5b5cb5f..fce1f9b424 100644 --- a/.gitpod.yml +++ b/.gitpod.yml @@ -2,3 +2,4 @@ image: file: .gitpod.Dockerfile tasks: - init: cargo build + command: cargo run From 680aeb12c2cea69ee82c49f70a22baf38d02d625 Mon Sep 17 00:00:00 2001 From: Blurryface05 Date: Sat, 28 Sep 2019 01:46:57 +0000 Subject: [PATCH 16/17] modified: README.md --- README.md | 48 +++++++++++++++++++++++++----------------------- 1 file changed, 25 insertions(+), 23 deletions(-) diff --git a/README.md b/README.md index 50f2e5100d..f0d7968cd6 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,8 @@ [![Crates.io](https://img.shields.io/crates/v/nu.svg)](https://crates.io/crates/nu) -[![Build Status](https://dev.azure.com/nushell/nushell/_apis/build/status/nushell.nushell?branchName=master)](https://dev.azure.com/nushell/nushell/_build/latest?definitionId=2&branchName=master) +[![Build Status](https://dev.azure.com/nushell/nushell/_apis/build/status/nushell.nushell?branchName=master)](https://dev.azure.com/nushell/nushell/_build/latest?definitionId=2&branchName=master) [![Discord](https://img.shields.io/discord/601130461678272522.svg?logo=discord)](https://discord.gg/NtAbbGn) - + # Nu Shell A modern shell for the GitHub era @@ -22,10 +22,12 @@ There are a few good resources to learn about Nu. There is a [book](https://book If you're a developer who would like to contribute to Nu, we're also working on a [book for developers](https://github.com/nushell/contributor-book/tree/master/en) to help get started. There are also [good first issues](https://github.com/nushell/nushell/issues?q=is%3Aopen+is%3Aissue+label%3A%22good+first+issue%22) to help you dive in. We also have an active [discord](https://discord.gg/NtAbbGn) and [twitter](https://twitter.com/nu_shell) if you'd like to come chat with us. +Try it in gitpod +[![Open in Gitpod](https://gitpod.io/button/open-in-gitpod.svg)](https://gitpod.io/#https://github.com/nushell/nushell) # Installation -## Local +## Local Up-to-date installation instructions can be found in the [installation chapter of the book](https://book.nushell.sh/en/installation). @@ -71,13 +73,13 @@ To build the base image: ```bash $ docker build -f docker/Dockerfile.nu-base -t nushell/nu-base . -``` +``` And then to build the smaller container (using a Multistage build): ```bash $ docker build -f docker/Dockerfile -t nushell/nu . -``` +``` Either way, you can run either container as follows: @@ -112,17 +114,17 @@ Commands are separated by the pipe symbol (`|`) to denote a pipeline flowing lef ``` /home/jonathan/Source/nushell(master)> ls | where type == "Directory" | autoview ━━━━┯━━━━━━━━━━━┯━━━━━━━━━━━┯━━━━━━━━━━┯━━━━━━━━┯━━━━━━━━━━━━━━┯━━━━━━━━━━━━━━━━ - # │ name │ type │ readonly │ size │ accessed │ modified + # │ name │ type │ readonly │ size │ accessed │ modified ────┼───────────┼───────────┼──────────┼────────┼──────────────┼──────────────── - 0 │ .azure │ Directory │ │ 4.1 KB │ 2 months ago │ a day ago - 1 │ target │ Directory │ │ 4.1 KB │ 3 days ago │ 3 days ago - 2 │ images │ Directory │ │ 4.1 KB │ 2 months ago │ 2 weeks ago - 3 │ tests │ Directory │ │ 4.1 KB │ 2 months ago │ 37 minutes ago - 4 │ tmp │ Directory │ │ 4.1 KB │ 2 weeks ago │ 2 weeks ago - 5 │ src │ Directory │ │ 4.1 KB │ 2 months ago │ 37 minutes ago - 6 │ assets │ Directory │ │ 4.1 KB │ a month ago │ a month ago + 0 │ .azure │ Directory │ │ 4.1 KB │ 2 months ago │ a day ago + 1 │ target │ Directory │ │ 4.1 KB │ 3 days ago │ 3 days ago + 2 │ images │ Directory │ │ 4.1 KB │ 2 months ago │ 2 weeks ago + 3 │ tests │ Directory │ │ 4.1 KB │ 2 months ago │ 37 minutes ago + 4 │ tmp │ Directory │ │ 4.1 KB │ 2 weeks ago │ 2 weeks ago + 5 │ src │ Directory │ │ 4.1 KB │ 2 months ago │ 37 minutes ago + 6 │ assets │ Directory │ │ 4.1 KB │ a month ago │ a month ago 7 │ docs │ Directory │ │ 4.1 KB │ 2 months ago │ 2 months ago -━━━━┷━━━━━━━━━━━┷━━━━━━━━━━━┷━━━━━━━━━━┷━━━━━━━━┷━━━━━━━━━━━━━━┷━━━━━━━━━━━━━━━━ +━━━━┷━━━━━━━━━━━┷━━━━━━━━━━━┷━━━━━━━━━━┷━━━━━━━━┷━━━━━━━━━━━━━━┷━━━━━━━━━━━━━━━━ ``` Because most of the time you'll want to see the output of a pipeline, `autoview` is assumed. We could have also written the above: @@ -136,12 +138,12 @@ Being able to use the same commands and compose them differently is an important ```text /home/jonathan/Source/nushell(master)> ps | where cpu > 0 ━━━┯━━━━━━━┯━━━━━━━━━━━━━━━━━┯━━━━━━━━━━┯━━━━━━━━━━ - # │ pid │ name │ status │ cpu + # │ pid │ name │ status │ cpu ───┼───────┼─────────────────┼──────────┼────────── - 0 │ 992 │ chrome │ Sleeping │ 6.988768 - 1 │ 4240 │ chrome │ Sleeping │ 5.645982 - 2 │ 13973 │ qemu-system-x86 │ Sleeping │ 4.996551 - 3 │ 15746 │ nu │ Sleeping │ 84.59905 + 0 │ 992 │ chrome │ Sleeping │ 6.988768 + 1 │ 4240 │ chrome │ Sleeping │ 5.645982 + 2 │ 13973 │ qemu-system-x86 │ Sleeping │ 4.996551 + 3 │ 15746 │ nu │ Sleeping │ 84.59905 ━━━┷━━━━━━━┷━━━━━━━━━━━━━━━━━┷━━━━━━━━━━┷━━━━━━━━━━ ``` @@ -153,9 +155,9 @@ Nu can load file and URL contents as raw text or as structured data (if it recog ``` /home/jonathan/Source/nushell(master)> open Cargo.toml ━━━━━━━━━━━━━━━━━━┯━━━━━━━━━━━━━━━━┯━━━━━━━━━━━━━━━━━━ - bin │ dependencies │ dev-dependencies + bin │ dependencies │ dev-dependencies ──────────────────┼────────────────┼────────────────── - [table: 12 rows] │ [table: 1 row] │ [table: 1 row] + [table: 12 rows] │ [table: 1 row] │ [table: 1 row] ━━━━━━━━━━━━━━━━━━┷━━━━━━━━━━━━━━━━┷━━━━━━━━━━━━━━━━━━ ``` @@ -164,7 +166,7 @@ We can pipeline this into a command that gets the contents of one of the columns ``` /home/jonathan/Source/nushell(master)> open Cargo.toml | get package ━━━━━━━━━━━━━━━━━┯━━━━━━━━━━━━━━━━━━━━━━━━━━━━┯━━━━━━━━━┯━━━━━━━━━┯━━━━━━┯━━━━━━━━━ - authors │ description │ edition │ license │ name │ version + authors │ description │ edition │ license │ name │ version ─────────────────┼────────────────────────────┼─────────┼─────────┼──────┼───────── [table: 3 rows] │ A shell for the GitHub era │ 2018 │ ISC │ nu │ 0.3.0 ━━━━━━━━━━━━━━━━━┷━━━━━━━━━━━━━━━━━━━━━━━━━━━━┷━━━━━━━━━┷━━━━━━━━━┷━━━━━━┷━━━━━━━━━ @@ -181,7 +183,7 @@ Here we use the variable `$it` to refer to the value being piped to the external ## Shells -Nu will work inside of a single directory and allow you to navigate around your filesystem by default. Nu also offers a way of adding additional working directories that you can jump between, allowing you to work in multiple directories at the same time. +Nu will work inside of a single directory and allow you to navigate around your filesystem by default. Nu also offers a way of adding additional working directories that you can jump between, allowing you to work in multiple directories at the same time. To do so, use the `enter` command, which will allow you create a new "shell" and enter it at the specified path. You can toggle between this new shell and the original shell with the `p` (for previous) and `n` (for next), allowing you to navigate around a ring buffer of shells. Once you're done with a shell, you can `exit` it and remove it from the ring buffer. From 78ccd4181c1dc2dca89c32492c0f913ab492a14a Mon Sep 17 00:00:00 2001 From: Sean Hellum Date: Fri, 27 Sep 2019 21:46:04 -0500 Subject: [PATCH 17/17] Update .gitpod.yml --- .gitpod.yml | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/.gitpod.yml b/.gitpod.yml index fce1f9b424..adb894f2d3 100644 --- a/.gitpod.yml +++ b/.gitpod.yml @@ -3,3 +3,19 @@ image: tasks: - init: cargo build command: cargo run +github: + prebuilds: + # enable for the master/default branch (defaults to true) + master: true + # enable for all branches in this repo (defaults to false) + branches: true + # enable for pull requests coming from this repo (defaults to true) + pullRequests: true + # enable for pull requests coming from forks (defaults to false) + pullRequestsFromForks: true + # add a "Review in Gitpod" button as a comment to pull requests (defaults to true) + addComment: true + # add a "Review in Gitpod" button to pull requests (defaults to false) + addBadge: false + # add a label once the prebuild is ready to pull requests (defaults to false) + addLabel: prebuilt-in-gitpod