add func cargo-init
This commit is contained in:
parent
845f83c3e0
commit
06e80254bd
@ -62,16 +62,13 @@ top-commands() {
|
||||
}' | sort | uniq -c | sort -nr | sed 's/^[[:space:]]*//'
|
||||
}
|
||||
|
||||
ci() {
|
||||
# Create cargo project (cargo init)
|
||||
cargo-init() {
|
||||
if [[ -v 1 ]]; then
|
||||
cargo init "${1}" && cd "${1}"
|
||||
cargo init "${1}" && cd "${1}" && \
|
||||
return "${?}"
|
||||
fi
|
||||
|
||||
local -r mktemp_template='thek4n-rust-XXXXXX'
|
||||
local temp
|
||||
temp="$(mktemp -dt "${mktemp_template}")" && \
|
||||
cd "${temp}" && \
|
||||
cargo init .
|
||||
local -r temp="/tmp/thek4n-rust-${RANDOM}"
|
||||
mkdir "${temp}" && cd "${temp}" && cargo init . && \
|
||||
return "${?}"
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user