Giter VIP home page Giter VIP logo

Comments (7)

andresgongora avatar andresgongora commented on May 24, 2024

The script should take care of everything but downloading the repo. That should be handled by the AUR package or the user. There should basically be an install.sh that does everything for the user. THe following function are desirable:

  • If the user has root privileges, put it somewhere on the system
  • If the user has no root privileges, ask where to put the scripts. Use the current pwd as default
  • Copy the example config files to ~/.config/scripts

from synth-shell.

andresgongora avatar andresgongora commented on May 24, 2024

Some dirty notes

If installed by AUR or DEB:
/usr/bin is for distribution-managed normal user programs.

If installed manually:
/usr/local/bin is for normal user programs not managed by the distribution package manager, e.g. locally compiled packages. You should not install them into /usr/bin because future distribution upgrades may modify or delete them without warning.

teh path of where to install it shoudl be an external script parameter, set by default to /usr/local/bin, but which might be overriden by AUR or DEB.
The installer should also check whether the script already exists in any other folder (/usr/local/bin or /usr/bin) regardless of how it is installed, and remove it.

To apply to all bashrc: /etc/bash.bashrc
But add several and reduntant checks to see if scripts are in place and so on
Also, DO NOT apply to root account
When modifying /etc/bash.bashrc, make sure there is not an entry for the scripts already in place. Ideally, do not add everything, but source a script that takes care of all.
That way, only 1 line is added to /etc/bash.bashrc and its easier to check and modify in the future

from synth-shell.

andresgongora avatar andresgongora commented on May 24, 2024

@olmari Can you test the script? The instructions are on the README.md file

from synth-shell.

andresgongora avatar andresgongora commented on May 24, 2024

Working on this to remove recursivity

from synth-shell.

andresgongora avatar andresgongora commented on May 24, 2024

by @olmari, extracted from his own bash.basrc: method to handle problems with the script

# if the command-not-found package is installed, use it
if [ -x /usr/lib/command-not-found -o -x /usr/share/command-not-found/command-not-found ]; then
	function command_not_found_handle {
	        # check because c-n-f could've been removed in the meantime
                if [ -x /usr/lib/command-not-found ]; then
		   /usr/lib/command-not-found -- "$1"
                   return $?
                elif [ -x /usr/share/command-not-found/command-not-found ]; then
		   /usr/share/command-not-found/command-not-found -- "$1"
                   return $?
		else
		   printf "%s: command not found\n" "$1" >&2
		   return 127
		fi
	}
fi

from synth-shell.

andresgongora avatar andresgongora commented on May 24, 2024

Added working installer and updated README to features/installer.

from synth-shell.

andresgongora avatar andresgongora commented on May 24, 2024

Installation works great. See latest push to branch features/installer.
But, I still have the following problem:

  • I'm unable to control when the hook is appended to /etc/bash.bashrc. Ideally, it should check if the hook is already present in the file (something like a multi-line grep) and only append it if not

  • Likewise, for the uninstaller, I really need to check if the hook is in /etc/bash.bashrc, and if so, delete it. Otherwise, the script will leave residues in the system.

In both cases, the hook is stored in the variable hook. The script should do the automatic append/removal using the content of said variable.

from synth-shell.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.