Merge pull request 'wood' (#3) from wood into master
Reviewed-on: http://wood.hell:8030/lachtan/linux-workspace/pulls/3
This commit is contained in:
@@ -10,6 +10,9 @@ end_of_line=lf
|
|||||||
indent_size = 4
|
indent_size = 4
|
||||||
indent_style = space
|
indent_style = space
|
||||||
|
|
||||||
|
[*.sh]
|
||||||
|
indent_size = 2
|
||||||
|
|
||||||
[*.md]
|
[*.md]
|
||||||
trim_trailing_whitespace = false
|
trim_trailing_whitespace = false
|
||||||
indent_size = 2
|
indent_size = 2
|
||||||
|
|||||||
13
README.md
13
README.md
@@ -3,6 +3,7 @@
|
|||||||
Repository of config files, scripts and other staff to enable quick and easy configuring a new computer.
|
Repository of config files, scripts and other staff to enable quick and easy configuring a new computer.
|
||||||
|
|
||||||
## Quick start
|
## Quick start
|
||||||
|
|
||||||
Add to $HOME/.bashrc file:
|
Add to $HOME/.bashrc file:
|
||||||
`source <full_path_to_repository>/bashrc`
|
`source <full_path_to_repository>/bashrc`
|
||||||
|
|
||||||
@@ -15,13 +16,11 @@ For debug log enabled
|
|||||||
`LWS_DEBUG=1`
|
`LWS_DEBUG=1`
|
||||||
|
|
||||||
## Quick commands
|
## Quick commands
|
||||||
```
|
|
||||||
|
```bash
|
||||||
# reload full configuration
|
# reload full configuration
|
||||||
reload-workspace
|
reload-workspace
|
||||||
# home directory of project
|
|
||||||
$LWS
|
|
||||||
```
|
|
||||||
|
|
||||||
### TODO
|
# home directory of project
|
||||||
- vim configuration
|
echo $LWS
|
||||||
- debian packages installation
|
```
|
||||||
|
|||||||
10
functions.sh
10
functions.sh
@@ -4,6 +4,14 @@ if [ -z "$time_ms" ]; then
|
|||||||
readonly time_ms='date +%s%3N'
|
readonly time_ms='date +%s%3N'
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
function is_fast_init() {
|
||||||
|
(( $LWS_FAST ))
|
||||||
|
}
|
||||||
|
|
||||||
|
function is_slow_init() {
|
||||||
|
! is_fast_init
|
||||||
|
}
|
||||||
|
|
||||||
function xlog() {
|
function xlog() {
|
||||||
if true_false "$LWS_DEBUG"; then
|
if true_false "$LWS_DEBUG"; then
|
||||||
echo "$@"
|
echo "$@"
|
||||||
@@ -70,7 +78,7 @@ function remove_path() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function uniq_path() {
|
function uniq_path() {
|
||||||
echo "$PATH" | tr ":" "\n" | awk '!seen[$0]++' | tr "\n" ":" | sed -r 's/:+/:/g' | sed -r 's/^:|:$//g'
|
path | awk '!seen[$0]++' | tr "\n" ":" | sed -r 's/:+/:/g' | sed -r 's/^:|:$//g'
|
||||||
}
|
}
|
||||||
|
|
||||||
function set_uniq_path() {
|
function set_uniq_path() {
|
||||||
|
|||||||
@@ -1,8 +1,12 @@
|
|||||||
# Initializae pyenv
|
# Initialize pyenv
|
||||||
|
|
||||||
if (( ! $LWS_FAST )); then
|
if is_slow_init; then
|
||||||
if can_run pyenv; then
|
PYENV_ROOT="${PYENV_ROOT:-$HOME/.pyenv}"
|
||||||
export PYENV_ROOT=${PYENV_ROOT:-$HOME/.pyenv}
|
if [[ -d "$PYENV_ROOT" ]]; then
|
||||||
|
export PYENV_ROOT
|
||||||
|
if ! can_run pyenv; then
|
||||||
|
append_path "$PYENV_ROOT/bin"
|
||||||
|
fi
|
||||||
eval "$(pyenv init -)"
|
eval "$(pyenv init -)"
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
# Loading direnv bash hook
|
# Loading direnv bash hook
|
||||||
|
|
||||||
if command -v direnv > /dev/null; then
|
if can_run direnv; then
|
||||||
eval "$(direnv hook bash)"
|
eval "$(direnv hook bash)"
|
||||||
fi
|
fi
|
||||||
|
|||||||
@@ -1,5 +1,3 @@
|
|||||||
if [[ -z "$LWS_FAST" ]]; then
|
if is_slow_init && can_run thefuck; then
|
||||||
if can_run thefuck; then
|
|
||||||
eval "$(thefuck --alias)"
|
eval "$(thefuck --alias)"
|
||||||
fi
|
|
||||||
fi
|
fi
|
||||||
|
|||||||
Reference in New Issue
Block a user