Comments (7)
Instead of creating an alias on bash profile, we can create a softlink in the usr/local/bin directory and name it yapi. Something like this:
sudo ln -s ~/YAPI/yapi.sh /usr/local/bin/yapi
with this you can call yapi even if you use zsh or a launcher.
from yapi.
I did not know about softlinking. This would be easier and I am going to change that to run. Does this need to run on every boot or terminal startup, similar to how alias is, or does it persist across boots?
from yapi.
I have tried this, however there is no change as python can't start from the softlink or alias.
from yapi.
You're right, this is because the YAPI files used are all in a directory and the python code refers to non-absolute paths so if you even alias (or create soft link) yapi.sh (or yapi.py) when you call it outside of the yapi directory will not work because the paths are wrong.
I arrived at this by doing some tests.
First of all I changed the yapi.sh like this:
cd ~/git/YAPI
python3 ~/git/YAPI/yapi.py $1 $2
Then create the softlink and i try to run it:
With these changes it works, but I dont know if this is worth it. What do you think?
from yapi.
I think this is fine. If you need, you can get current path with os and append the relative path. This could help running, but your solution should work. The only question I have is if subprocess is in a new terminal and would need to cd into the correct directory.
from yapi.
If yapi.sh have this line:
https://github.com/YetAnotherPackageInstaller/YAPI/blob/ede201b7a08efce71479ba271c458ec816fa4261/yapi.sh#L1
the problem no longer exists.
from yapi.
Yes this is not the right method to handle this problem, but for now this is the easiest way. I will open a new issue for this new problem: "set up absolute path"
from yapi.
Related Issues (20)
- New script: etcher
- New script: ramme
- New script: windows 95
- New script: tweet-tray
- New script: simplenote
- New script: Notable
- New script: rofi last version HOT 2
- Rambox dependencies
- light package dependencies
- spotify change method
- java problem with oracle autentications HOT 3
- i3battery - Script
- flash update - new script
- anaconda - new script
- yed works - new script
- abricotine - new script
- Albert - new script
- mongodb - new script
- draw.io - new script
- Heroku
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from yapi.