Skip to content
项目

关于

Crush 是一个命令行 Shell,同时也是一种功能强大的现代编程语言。

编程语言与运行时

这些数字如何统计

实测星标增长

24小时
0
7天
0
15天
+3
1个月
+2

各周期内的星标净变化,周期相互重叠,并非每日新增。缺失的测量保持空白。星标代表关注度,不代表软件质量。

README.md

原文

Crush

Crush is an attempt to make a traditional command line shell that is also a modern programming language. It has the features one would expect from a modern programming language like a type system, closures and lexical scoping, but with a syntax geared toward both batch and interactive shell usage.

Building and installing Crush

OS X dependencies

  • Install Brew.
  • Install openssl brew install openssl
  • Install protobuf brew install protobuf
  • Install git xcode-select --install

Ubuntu dependencies

  • Update apt index sudo apt update
  • Install dependencies sudo apt install build-essential git curl pkg-config libssl-dev libdbus-1-dev libsystemd-dev protobuf-compiler-grpc

Install Rust

Install Rust

curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh

The installer adds ~/.cargo/bin to your path in new shells. To use it in the shell you installed it from, run

. "$HOME/.cargo/env"

Compile and install crush

clone this repository,

git clone https://github.com/liljencrantz/crush.git

and run

cd crush && cargo install --path .

and you should have a working binary to try out in ~/.cargo/bin. That directory should already be in your path, so just write crush to run the shell.

Overriding the system config directory

Crush looks for a system-wide config file (config.crush) and a system-wide modules directory (see docs/config.md) under /etc by default. A packager building for a different prefix can override this at build time by setting the CRUSH_SYSCONFDIR environment variable, the same way ./configure --sysconfdir=... would for an autoconf-based project:

CRUSH_SYSCONFDIR=/usr/local/etc cargo install --path .

This is baked into the resulting binary at compile time, not read from the environment at runtime -- rebuilding (even just touch build.rs && cargo build) is required to pick up a changed value.

Have fun!

探索相关项目

加载中…