Skip to content

Commit

Permalink
Break out build and install scripts (#10)
Browse files Browse the repository at this point in the history
Separate build and install logic into 2 scripts, update README accordingly
  • Loading branch information
peterjmorgan committed Apr 1, 2021
1 parent dbd9e83 commit 2e3018e
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 3 deletions.
10 changes: 9 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,15 +34,23 @@ SUBCOMMANDS:
## Releases
Currently, releases of phylum-cli are statically-built for linux x64.

## Installation
Currently, releases of phylum-cli are statically-built for linux x64. If you need another architecture, see the section below on Building.

An install script is provided for both releases and git versions. The script creates a `$HOME/.phylum` directory and copies the required files.

This script also **adds the .phylum directory to the user's PATH** on bash.

## Building
Phylum-cli is written in Rust, so you'll need a recent Rust installation to build it. [Install Rust](https://www.rust-lang.org/tools/install)
1. Clone repository
```sh
git clone https://github.com/phylum-dev/cli
```
2. Run install script in cli/lib
2. Run build and install scripts in cli/lib
```sh
cd cli/lib
bash build.sh
bash install.sh
```

Expand Down
2 changes: 2 additions & 0 deletions lib/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#!/bin/bash
cargo install --path .
10 changes: 8 additions & 2 deletions lib/install.sh
Original file line number Diff line number Diff line change
@@ -1,8 +1,14 @@
#!/bin/bash
cargo install --path .
mkdir -p ${HOME}/.phylum
cp -n src/bin/settings.yaml ${HOME}/.phylum/
cp -f src/bin/phylum-cli.bash ${HOME}/.phylum/

echo "source \$HOME/.phylum/phylum-cli.bash" >> ${HOME}/.bashrc
if ! grep -q 'phylum-cli.bash' $HOME/.bashrc ;
then
echo "source \$HOME/.phylum/phylum-cli.bash" >> ${HOME}/.bashrc
fi
if ! grep -q '.phylum/:\$PATH' $HOME/.bashrc;
then
echo 'export PATH="$HOME/.phylum/:$PATH"' >> ${HOME}/.bashrc
fi

0 comments on commit 2e3018e

Please sign in to comment.