Crates.io | gcd-cli |
lib.rs | gcd-cli |
version | 1.2.0 |
source | src |
created_at | 2020-04-29 14:06:20.000876 |
updated_at | 2021-09-14 18:46:21.55633 |
description | gcd-cli tools for managing and using GCD. GCD stands for GitChangeDirectory, as it primary goal is to quickly change between git project folders. |
homepage | http://gitlab.com/pnmtjonahen/pepercoin |
repository | http://gitlab.com/pnmtjonahen/pepercoin |
max_upload_size | |
id | 235346 |
size | 116,576 |
Primary used for quickly navigating between git projects.
Supports
Note: A git project folders is a folder that has a '.git' sub folder, no other checks are done.
Currently you need to build the binaries your self.
A working Rust build system https://www.rust-lang.org/tools/install.
Get the code from.
git clone https://gitlab.com/pnmtjonahen/pepercoin.git
Build and install it.
cargo install --path .
Once the console dependency is updated this will change in a normal cargo install
Install the binaries as described above.
Either copy the gcd script from the scripts folder into your ${HOME}/bin folder. (or equivalent, like ${HOME}/.cargo/bin)
Or create a gcd.sh script as follows
#!/bin/bash
SCRIPT_FILE="${HOME}/.gcd/gcd-cd.sh"
gcd-select $@
if [[ -f "${SCRIPT_FILE}" ]]; then
source ${SCRIPT_FILE}
rm ${SCRIPT_FILE}
fi
And lastly, make an entry into your .bash_aliases file like:
alias gcd='source /home/user/.cargo/bin/gcd.sh'
Note: sourcing the shell script is needed else the internal 'cd' command will not work as expected.
Either copy the gcd.bat script from the scripts folder into your path folder. like ${APPDATA}/.cargo/bin
Or create a gcd script as follows
@echo off
call gcd-select
if exist %APPDATA%\.gcd\gcd-cd.bat (
%APPDATA%\.gcd\gcd-cd.bat
del /s %APPDATA%\.gcd\gcd-cd.bat
)
after installation call the gcd init to initialize the database and perform the initial search for projects_dir
gcd-init
gcd is made up out of a number of different applications. Gcd-select is the main one, it is however not called directly but via a shell script.
gcd-select, called from the gcd script and is used to select a project.
gcd-init, initializes the database. it will overwrite the complete database. loosing all usage data, and aliases.
gcd-alias, set an alias for the current folder, if the current folder is not a known project. nothing will happen.
gcd-add, adds the current folder to the database.
gcd-purge, purges aka removes all project from the database that are no longer available.
gcd-delete, removes the current folder from the database.
gcd-update, updates the database, as opposed to the gcd-init, this will only add projects that are not yet in the database
gcd-mv, move a project onto a new folder. When moving git projects on disc use this to update the gcd database with the new location.
sudo snap install jq
rustup component add llvm-tools-preview
cargo install cargo-binutils
cargo install rustfilt
and
rustup default nightly
cargo clean
LLVM_PROFILE_FILE="./target/coverage/gcd-%p-%m.profraw" RUSTFLAGS="-Z instrument-coverage" cargo test
cargo profdata -- merge -sparse ./target/coverage/gcd-*.profraw -o ./target/coverage/gcd.profdata
cargo cov -- report \
$( \
for file in \
$( \
RUSTFLAGS="-Z instrument-coverage" \
cargo test --tests --no-run --message-format=json \
| jq -r "select(.profile.test == true) | .filenames[]" \
| grep -v dSYM - \
); \
do \
printf "%s %s " -object $file; \
done \
) \
-object ./target/debug/gcd-add \
-object ./target/debug/gcd-alias \
-object ./target/debug/gcd-delete \
-object ./target/debug/gcd-init \
-object ./target/debug/gcd-mv \
-object ./target/debug/gcd-purge \
-object ./target/debug/gcd-select \
-object ./target/debug/gcd-update \
--instr-profile=./target/coverage/gcd.profdata --summary-only --ignore-filename-regex='/.cargo/registry|/rustc'
cargo cov -- show \
$( \
for file in \
$( \
RUSTFLAGS="-Z instrument-coverage" \
cargo test --tests --no-run --message-format=json \
| jq -r "select(.profile.test == true) | .filenames[]" \
| grep -v dSYM - \
); \
do \
printf "%s %s " -object $file; \
done \
) \
-object ./target/debug/gcd-add \
-object ./target/debug/gcd-alias \
-object ./target/debug/gcd-delete \
-object ./target/debug/gcd-init \
-object ./target/debug/gcd-mv \
-object ./target/debug/gcd-purge \
-object ./target/debug/gcd-select \
-object ./target/debug/gcd-update \
--instr-profile=./target/coverage/gcd.profdata --format=html --output-dir=./target/coverage/report --ignore-filename-regex='/.cargo/registry|/rustc'