Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: xvxx/phd
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v0.1.13
Choose a base ref
...
head repository: xvxx/phd
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: master
Choose a head ref
  • 12 commits
  • 8 files changed
  • 1 contributor

Commits on Aug 22, 2020

  1. Copy the full SHA
    10ba1ca View commit details

Commits on Nov 17, 2020

  1. update changelog on release

    xvxx committed Nov 17, 2020
    Copy the full SHA
    0db0c7e View commit details
  2. NO_COLOR support

    xvxx committed Nov 17, 2020
    Copy the full SHA
    2e78294 View commit details
  3. (cargo-release) version 0.1.14

    xvxx committed Nov 17, 2020
    Copy the full SHA
    be85890 View commit details
  4. Copy the full SHA
    fb304bc View commit details

Commits on Jan 5, 2022

  1. update status

    xvxx authored Jan 5, 2022

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    a0ab2fa View commit details

Commits on Nov 28, 2022

  1. update gh actions

    xvxx committed Nov 28, 2022
    Copy the full SHA
    5555046 View commit details
  2. Copy the full SHA
    ae866b4 View commit details
  3. Copy the full SHA
    6761e1d View commit details

Commits on Dec 4, 2022

  1. update changelog

    xvxx committed Dec 4, 2022
    Copy the full SHA
    006a3f5 View commit details
  2. update cargo-release

    xvxx committed Dec 4, 2022
    Copy the full SHA
    1e31a05 View commit details
  3. Copy the full SHA
    5b02ccc View commit details
Showing with 69 additions and 47 deletions.
  1. +3 −3 .github/workflows/build.yml
  2. +9 −9 .github/workflows/release.yml
  3. +12 −3 CHANGELOG.md
  4. +21 −21 Cargo.lock
  5. +3 −3 Cargo.toml
  6. +11 −7 README.md
  7. +6 −0 src/main.rs
  8. +4 −1 src/server.rs
6 changes: 3 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -49,17 +49,17 @@ jobs:
steps:
- uses: actions/checkout@v1
- name: Cache cargo registry
uses: actions/cache@v1
uses: actions/cache@v3
with:
path: ~/.cargo/registry
key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }}
- name: Cache cargo index
uses: actions/cache@v1
uses: actions/cache@v3
with:
path: ~/.cargo/git
key: ${{ runner.os }}-cargo-index-${{ hashFiles('**/Cargo.lock') }}
- name: Cache cargo build
uses: actions/cache@v1
uses: actions/cache@v3
with:
path: target
key: ${{ runner.os }}-cargo-build-target-${{ hashFiles('**/Cargo.lock') }}
18 changes: 9 additions & 9 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -13,17 +13,17 @@ jobs:
- name: Checkout
uses: actions/checkout@v2
- name: Cache cargo registry
uses: actions/cache@v1
uses: actions/cache@v3
with:
path: ~/.cargo/registry
key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }}
- name: Cache cargo index
uses: actions/cache@v1
uses: actions/cache@v3
with:
path: ~/.cargo/git
key: ${{ runner.os }}-cargo-index-${{ hashFiles('**/Cargo.lock') }}
- name: Cache cargo build
uses: actions/cache@v1
uses: actions/cache@v3
with:
path: target
key: ${{ runner.os }}-cargo-build-target-${{ hashFiles('**/Cargo.lock') }}
@@ -57,17 +57,17 @@ jobs:
- name: Checkout
uses: actions/checkout@v2
- name: Cache cargo registry
uses: actions/cache@v1
uses: actions/cache@v3
with:
path: ~/.cargo/registry
key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }}
- name: Cache cargo index
uses: actions/cache@v1
uses: actions/cache@v3
with:
path: ~/.cargo/git
key: ${{ runner.os }}-cargo-index-${{ hashFiles('**/Cargo.lock') }}
- name: Cache cargo build
uses: actions/cache@v1
uses: actions/cache@v3
with:
path: target
key: ${{ runner.os }}-cargo-build-target-${{ hashFiles('**/Cargo.lock') }}
@@ -90,17 +90,17 @@ jobs:
steps:
- uses: actions/checkout@v1
- name: Cache cargo registry
uses: actions/cache@v1
uses: actions/cache@v3
with:
path: ~/.cargo/registry
key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }}
- name: Cache cargo index
uses: actions/cache@v1
uses: actions/cache@v3
with:
path: ~/.cargo/git
key: ${{ runner.os }}-cargo-index-${{ hashFiles('**/Cargo.lock') }}
- name: Cache cargo build
uses: actions/cache@v1
uses: actions/cache@v3
with:
path: target
key: ${{ runner.os }}-cargo-build-target-${{ hashFiles('**/Cargo.lock') }}
15 changes: 12 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,20 @@
## v0.1.13-dev
## v0.1.15

- Update `alphanumeric-sort` dependency so `cargo install phd` works again.
- Recommend `cargo install phd --locked` in the README

## v0.1.14

- If the `NO_COLOR` env variable is set, colors won't be printed to
the log. Same as starting with `--no-color`.
See https://no-color.org/.

## v0.1.13

- Added `--no-color` command line option to not display color when
logging.
- Slight change to binding behavior: if `-p` is passed without `-b`,
we'll try to bind to that port. To this easier: `phd -p 7777`
we'll try to bind to that port. To this easier: `phd -p 7777`
- Accept `?` as query string indicator, not just `TAB`. See #3.

## v0.1.12
@@ -29,7 +39,6 @@ For now you can view it by cloning the repository and running:

Enjoy!


## v0.1.10

`phd` can now render a single page to stdout, instead of starting
42 changes: 21 additions & 21 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "phd"
version = "0.1.13"
version = "0.1.15"
authors = ["chris west <c@xvxx.io>"]
license = "MIT"
edition = "2018"
@@ -22,11 +22,11 @@ opt-level = 'z' # Optimize for size.
pre-release-replacements = [
{file="README.md", search="phd-v\\d+\\.\\d+\\.\\d+-", replace="{{crate_name}}-v{{version}}-"},
{file="README.md", search="/v\\d+\\.\\d+\\.\\d+/", replace="/v{{version}}/"},
{file="CHANGELOG.md", search="\\d+\\.\\d+\\.\\d+-dev", replace="{{version}}"},
]
dev-version-ext = "dev"

[dependencies]
content_inspector = "0.2.4"
threadpool = "1.7.1"
alphanumeric-sort = "1.0.11"
alphanumeric-sort = "1.4"
shell-escape = "0.1.4"
18 changes: 11 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -166,15 +166,15 @@ On macOS you can install with [Homebrew](https://brew.sh/):
Binaries for Linux, Mac, and Raspberry Pi are available at
gopher://phkt.io/1/releases/phd and https://github.com/xvxx/phd/releases:

- [phd-v0.1.13-linux-x86_64.tar.gz][0]
- [phd-v0.1.13-linux-armv7.tar.gz (Raspberry Pi)][1]
- [phd-v0.1.13-macos.zip][2]
- [phd-v0.1.15-linux-x86_64.tar.gz][0]
- [phd-v0.1.15-linux-armv7.tar.gz (Raspberry Pi)][1]
- [phd-v0.1.15-macos.zip][2]

Just unzip/untar the `phd` program into your `$PATH` and get going!

If you have **[cargo][rustup]**, you can install the crate directly:

cargo install phd
cargo install phd --locked

## ~ development ~

@@ -193,9 +193,13 @@ If you have **[cargo][rustup]**, you can install the crate directly:
- [ ] TLS support
- [ ] user input sanitization tests

[0]: https://github.com/xvxx/phd/releases/download/v0.1.13/phd-v0.1.13-linux-x86_64.tar.gz
[1]: https://github.com/xvxx/phd/releases/download/v0.1.13/phd-v0.1.13-linux-armv7.tar.gz
[2]: https://github.com/xvxx/phd/releases/download/v0.1.13/phd-v0.1.13-macos.zip
## ~ status ~

phd is no longer under active development, but the latest version works great.

[0]: https://github.com/xvxx/phd/releases/download/v0.1.15/phd-v0.1.15-linux-x86_64.tar.gz
[1]: https://github.com/xvxx/phd/releases/download/v0.1.15/phd-v0.1.15-linux-armv7.tar.gz
[2]: https://github.com/xvxx/phd/releases/download/v0.1.15/phd-v0.1.15-macos.zip
[map]: https://en.wikipedia.org/wiki/Gopher_(protocol)#Source_code_of_a_menu
[gmi]: http://r-36.net/scm/geomyidae/
[rustup]: https://rustup.rs
6 changes: 6 additions & 0 deletions src/main.rs
Original file line number Diff line number Diff line change
@@ -13,6 +13,7 @@ fn main() {
let mut host = DEFAULT_HOST;
let mut port = DEFAULT_PORT;
let mut render = "";

while let Some(arg) = args.next() {
match arg.as_ref() {
"--version" | "-v" | "-version" => return print_version(),
@@ -64,6 +65,11 @@ fn main() {
}
}

// https://no-color.org/
if std::env::var("NO_COLOR").is_ok() {
phd::color::hide_colors()
}

// If port was given and socket wasn't, bind to that port.
let bind = if port != DEFAULT_PORT && addr == DEFAULT_BIND {
format!("[::]:{}", port).parse().unwrap()
5 changes: 4 additions & 1 deletion src/server.rs
Original file line number Diff line number Diff line change
@@ -410,7 +410,10 @@ fn sort_paths(dir_path: &str, reverse: bool) -> Result<Vec<DirEntry>> {
let a_is_dir = is_dir(a);
let b_is_dir = is_dir(b);
if a_is_dir && b_is_dir || !a_is_dir && !b_is_dir {
let ord = alphanumeric_sort::compare_os_str(a.path().as_ref(), b.path().as_ref());
let ord = alphanumeric_sort::compare_os_str::<&Path, &Path>(
a.path().as_ref(),
b.path().as_ref(),
);
if reverse {
ord.reverse()
} else {