Commit Graph

71 Commits (1039a80ecd958a928e0c1682f6b6800378242f00)

Author SHA1 Message Date
sebokopter 1039a80ecd Easily 'enter' the installation process
* install.sh
- Added a Choice to add existing .bash_profile to bash-it version.
- Also it is possible to only 'enter' the installaion process.
- Improved yes/no query for funtion load_some()
2021-11-19 03:13:22 +02:00
nickl- 356d354258 Updated documentation
Documentation to reflect changes made to the `install.sh` installation script.
2021-11-19 03:10:06 +02:00
nickl- 76d2d72383 Added minimum comments
Feeling generous
2021-11-19 03:06:14 +02:00
nickl- feb8d098de How about a direct install with bash, curl and github
* Use curl to retrieve the raw install script from github
 * Execute payload directly with bash -c without requiring file write
 * Detect bash execution (as apposed to terminal or script file execution) and assume that this is a direct install
 * On direct install
 * * purge ~/.bash_it if present
 * * git clone repo to ~/.bash_it
 * * continue installation as normal
2021-11-19 03:03:36 +02:00
nickl- 061cca5304 Readjust output based on single char input strategy 2021-11-19 03:00:41 +02:00
nickl- c78251fc27 Jekyll prompt use single char input 2021-11-19 03:00:41 +02:00
nickl- 6b2eff2f0f Use bash string parsing in favour of basename 2021-11-19 03:00:39 +02:00
nickl- f5268d91ff Fix minor glitch introduced by string concatenation 2021-11-19 02:58:36 +02:00
nickl- bb1452bb84 We do insist though, you locate us at ~/.bash_it 2021-11-19 02:58:36 +02:00
nickl- 19fe69e566 What if .bash_profile doesn't exist?
We get an error from cp
We still respond that we made a backup
Instead if .bas_profile exists and cp is a success then prompt informing the user that we made a backup
or inform them that no .bash_profile was found so no need to make a back up at this point.
2021-11-19 02:58:33 +02:00
nickl- d4d3d8c9e8 Where did my original .bash_profile go?
It's nice that we make a backup but…
 * what if a back-up already exists?
 * what if this is the 2nd, 3rd or 4th time I'm executing the script?

We backup to .bash_profile.bak or .bash_plofile.bak.{count} if .bash_plofile.bak already exists.
iow
.bash_plofile.bak if not exist
.bash_plofile.bak.1 if exists
.bash_plofile.bak.2 if 2 exists
.bash_plofile.bak.3 if 3 exists etc…

Newest backup with the highest number.
2021-11-19 02:57:41 +02:00
nickl- 3ecc3a6038 Then use $BASH_IT
Now that we've gone through all that trouble to define $BASH_IT lets use it then.
2021-11-19 02:57:07 +02:00
nickl- b547b107bc Deduce $BASH_IT relative to install script location at execution
Instead of assuming it is located at ~/.bash_it which might very well not be the case
2021-11-19 02:55:47 +02:00
nickl- 6f0a147c01 Fix code style
At least a general conformance to the same style if nothing else
Based on what appeared to be the most used or most sensible conventions which lead to the following
Braces around variables
Preserve quotes and quote paths
statements begin on the same line
No trailing white space
Respect 120 chars page width at least
Use brackets instead of back-ticks
Two space indent 4 space continuation
No logic was harmed in the making of this commit.
2021-11-19 02:53:31 +02:00
Noah Gorny 0dbf1d593c
Merge pull request #1926 from gaelicWizard/basenamed
Use parameter substitution instead of `dirname`/`basename`, where safe to do so
2021-09-18 18:26:55 +03:00
John D Pell 1c3cbf7ca6
Delete `.shellcheckrc` (#1947)
* CI: disable Ubuntu 16.04 as it's EOL

https://github.blog/changelog/2021-04-29-github-actions-ubuntu-16-04-lts-virtual-environment-will-be-removed-on-september-20-2021/

* main: lint false positive

* install: lint

* plugins/cmd-returned-notify: don't `export`

* plugins/xterm: lint

* plugins/git: lint

* plugins/goenv: lint

* plugins/alias-completion: lint false positives

* plugins/alias-completion: fix SC2155, SC2154

Declare `locals` at the top of the function

* completion: lint completions using `bash_completion` functions

Match the style of the existing code

* completion/knife: lint false positives

* completion/knife: lint

* completion/sdkman: lint

* completion/composer: lint

* Move `.shellcheckrc` under `themes/`

* lib/theme: fix SC2155, SC2154, SC2034

* lib/colors: don't warn on unused variables

We assign a large number of variables here and they may or may not be used anywhere else, so disable SC2034 for this file (only).

Alsö disable SC2005 as the functions in this file were written before `printf` was invented and have to do some fancy metascripting to get escape sequences interpreted reliably. I’m not smart enough to fix this to use `printf`, so leave it for now.

* themes/agnoster: lint

* themes: disable SC2154 for colors

Each one of these themes will need it’s own fix for SC2154, possibly upstream.

Due to the way themes are, it's entirely normal to have a *lot* of false positives for SC2034. So much so, that I have to admit that it is probably just not worth linting for SC2034 despite my dislike of blanket ignore rules.

* themes: disable SC2154, fix SC2155

Each one of these themes will need it’s own fix for SC2154, possibly upstream.

Due to the way themes are, it's entirely normal to have a *lot* of false positives for SC2034. So much so, that I have to admit that it is probably just not worth linting for SC2034 despite my dislike of blanket ignore rules.

* Delete `.shellcheckrc`

* remove executable bit
2021-09-18 12:50:59 +03:00
John D Pell dee55a03cc drop `dirname` in favor of native Bash strings (1 of 2)
Convert `var=${dirname $filename)` to `var="${filename%/*}` in cases where there is no ambiguity.

Make sure that the path in `$BASH_IT` is absolute because this path gets embedded in the template `.bash_profile` file if selected by the user.
2021-09-16 16:59:02 -07:00
Noah Gorny a8b43620f8 install: Dont quote number vars, to support older bash versions 2021-04-01 17:59:59 +03:00
Noah Gorny 5c192575ce install: Add bash-it prefix to all functions 2021-02-06 20:36:04 +02:00
Noah Gorny 3e7adde638 install: Move to double brackets in check_for-backup check 2021-02-06 20:25:56 +02:00
Noah Gorny af17501318 install: Add --overwrite-backup flag
This will ensure users will specify whether they want to overwrite the
backup or not, and check it even when we do silent installation
This does change the default behaviour and exits if the -f flag is not
specified and a backup is present.
2021-02-06 00:15:20 +02:00
Noah Gorny 9e37f0d09e install: Move backup check into a separate function 2021-02-06 00:15:20 +02:00
Noah Gorny ef10bcd151 install: Move modify config check into separate function
This helps us make the logic easier to read, and remove unneeded
confusion.
2021-02-06 00:15:20 +02:00
buhl 49d7d2e8c4 Getting Bash-it to use the vendored composure
Fixed tests
Fixed install.sh and bash_it.sh
Added gitattributes to the vendor folder
Changed documentation
2021-02-02 16:34:04 +01:00
Noah Gorny 501b1ab3b5
Merge pull request #1730 from NoahGorny/fix-1037
Disable auto-reload in install.sh
2020-12-16 20:08:06 +02:00
egvimo 3019dc331d
Add option to append template to existing config (#1723)
* Add option to append template to existing config

* Add test for append-to-config option

Co-authored-by: Egor Moor <egor.moor@edag-ps.com>
2020-12-11 16:32:23 +02:00
Noah Gorny e873252227 Disable auto-reload in install.sh 2020-12-06 23:55:25 +02:00
Kyle Welsby 56945e3bdf
Fixes #1309 _bash-it-clean-component-cache: command not found
Silence errors when installing

```
Would you like to enable the ag aliases? [y/N] y
~/.bash_it/lib/helpers.bash: line 488: _bash-it-clean-component-cache: command not found
ag enabled with priority 150.
```
2019-01-16 17:15:23 +00:00
polytomous 82ee86222e
INSANE EDIT: Pick a less crazy word than "sane" 2018-03-16 18:51:48 -07:00
Nils Winkler 54774d4f59 Using the existing enable function for interactive install 2017-06-24 17:31:30 +02:00
Nils Winkler 3ecf684eb6 Switched loading of single components to existing functions 2017-06-24 17:31:30 +02:00
林博仁 63c4ace648 Make installer more path-with-spaces-proof, fixes #952
NOTE: This doesn't make Bash-it usable as there's so many similar errors scattered in other locations, this commit simply makes installer works

Signed-off-by: 林博仁 <Buo.Ren.Lin@gmail.com>
2017-05-02 11:06:19 +08:00
Shingo Kitagawa 00d17ff16a add --no-modify-config flag to install.sh 2016-11-04 17:42:40 +09:00
ravenhall 49afeb707e Added forgotten -e and moved funcs to the top to prevent scoping issue 2016-05-31 18:45:36 -05:00
ravenhall c6c21abb0e Colorized error, relocated installing message, created backup_new func, reformatted do 2016-05-31 14:14:12 -05:00
ravenhall 11311b17f6 Implemented solution to issue #676 2016-05-19 22:08:46 -05:00
Nils Winkler 696d0e50b0 Fixed indentation
Removed tabs, using 2 spaces everywhere.
2016-01-08 08:26:55 +01:00
Nils Winkler 28071aba21 Merge pull request #641 from spectrumIG/Issue-621
Add follow sym link and option to append template to existing .bashrc
2016-01-08 08:20:06 +01:00
Daniele Andreoli 245fcfa49b Fix wrong pipe. Add in any case a backup file for compatibility 2016-01-08 02:20:18 +01:00
Daniele Andreoli fdc75e42b9 Add while block to allow correct choice 2016-01-07 09:23:36 +01:00
Daniele Andreoli 55245cc98e Fix typo and missing spaces 2016-01-07 09:20:23 +01:00
Daniele Andreoli a3efe1479a Add follow sym link and option to append template to existing .bashrc 2016-01-06 12:53:05 +01:00
Nils Winkler 38bd3a3b99 Loading Homebrew Bash Completion if installed
In addition to the regular /etc/bash_completion, the one from Homebrew
is loaded when running on OS X, and when Homebrew is installed.

Also added the system completion to the default install options, since
this is a feature that's requested frequently.
2016-01-05 07:35:02 +01:00
Nils Winkler 127ac23eea Added base plugin to default install
Fixes #609
2015-12-22 09:42:22 +01:00
Nils Winkler c0a214294d Merge pull request #598 from justin8/change-install-location
Fix for OS X installation
2015-10-22 16:26:40 +02:00
Justin Dray dd8831faf1 Fix for OS X installation 2015-10-22 16:20:44 +02:00
Nils Winkler d8e16c36a2 Merge pull request #589 from justin8/change-install-location
Allow for any install location
2015-10-21 09:14:51 +02:00
Justin Dray dad983adb5 Remove exit from install. Update readme for install locations 2015-10-16 16:27:58 +02:00
Nils Winkler 36caf70f8d Renamed alias-completion file to match naming conventions 2015-10-15 11:28:58 +02:00
Nils Winkler c43f3d8327 Enabling general aliases by default 2015-10-15 11:28:49 +02:00