Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add "$REALDIR" variable to "APP-MANAGER" and "install.am" to keep the shell in the current directory #793

Merged
merged 8 commits into from
Jul 18, 2024

Conversation

ivan-hc
Copy link
Owner

@ivan-hc ivan-hc commented Jul 18, 2024

Fix #653

ivan-hc added 2 commits July 18, 2024 05:46
...this is used to keep the shell in the current directory
@ivan-hc ivan-hc changed the title Fix https://github.com/ivan-hc/AM/issues/653 Add "$REALDIR" variable to "APP-MANAGER" and "install.am" to keep the shell in the current directory Jul 18, 2024
@Samueru-sama
Copy link
Contributor

I think REALDIR=$(pwd) can just be REALDIR=$PWD

Because as far as I know the shell already sets the $PWD env variable, so maybe it is not needed to be calling pwd to know that?

I haven't tested it though.

@ivan-hc
Copy link
Owner Author

ivan-hc commented Jul 18, 2024

I think REALDIR=$(pwd) can just be REALDIR=$PWD

Because as far as I know the shell already sets the $PWD env variable, so maybe it is not needed to be calling pwd to know that?

I haven't tested it though.

tested, and worked

@ivan-hc
Copy link
Owner Author

ivan-hc commented Jul 18, 2024

we have another issue now: priority!

see what happens if in the PWD directory exists a file with the name of an argument

Istantanea_2024-07-18_16-10-05

@ivan-hc
Copy link
Owner Author

ivan-hc commented Jul 18, 2024

by inverting the priority order, the module will check hosted arguments before the local ones

					if test -f "$AMPATH/neodb"; then
						_install_from_third_party_repo
					elif curl --output /dev/null --silent --head --fail "$APPSDB"/"$arg"  1>/dev/null; then
						_install_normally
					elif test -f "$arg" 2> /dev/null; then
						_install_local_script
					else
						echo " 💀 ERROR: \"$arg\" does NOT exist in the database, see \"$AMCLI -l\""
					fi

Istantanea_2024-07-18_16-14-00

@ivan-hc
Copy link
Owner Author

ivan-hc commented Jul 18, 2024

this will conflict with our style of tests: I should rename my scripts to .sh as you do

its not the way I wanted to made this to work for

@ivan-hc
Copy link
Owner Author

ivan-hc commented Jul 18, 2024

the last commit solves all issues

her I added an echo "$arg" to show the name of the argument

Istantanea_2024-07-18_17-16-12

@ivan-hc
Copy link
Owner Author

ivan-hc commented Jul 18, 2024

and to be sure that "chromium" is not installed using other cases, I disabled tadabases in this test and this is the result

Istantanea_2024-07-18_17-19-15

@ivan-hc
Copy link
Owner Author

ivan-hc commented Jul 18, 2024

the last commit adds a message in case of missing file

Istantanea_2024-07-18_17-56-07 png

@ivan-hc
Copy link
Owner Author

ivan-hc commented Jul 18, 2024

Just tested on Fedora and works.

@ivan-hc ivan-hc merged commit eb7e869 into main Jul 18, 2024
3 checks passed
@ivan-hc ivan-hc deleted the dev branch July 18, 2024 16:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Sometimes running am -i on a local script fails the first time
2 participants