Make an equivalent Linux script
From https://www.reddit.com/r/Julia/comments/gbedwz/julia_windows_installation_script_with_batteries/fp7s8xl/
- write python or bash code to replace the Windows
.batparts - get to the Julia part as fast as possible, and try to cross-platform generalise as much as poossible
- maybe seperate the bat / julia / python code and allow the installer scripts to automatically get the julia part from github as a proper
.jlfile (added security issues). - get some bash glue going to replace the
.batentry points
This is a good template for the bash glue:
#--------------------------------------------------
# I might be a symlink, so here is my actual location
#--------------------------------------------------
#From https://stackoverflow.com/a/246128
SOURCE="${BASH_SOURCE[0]}"
while [ -h "$SOURCE" ]; do # resolve $SOURCE until the file is no longer a symlink
DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )"
SOURCE="$(readlink "$SOURCE")"
# if $SOURCE was a relative symlink, we need to resolve it relative to the path where the symlink file was located
[[ $SOURCE != /* ]] && SOURCE="$DIR/$SOURCE"
done
DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )"
#--------------------------------------------------
# Setup the environment variables and paths for Juliawin
#--------------------------------------------------
__environmentcode__
#--------------------------------------------------
# Finally, run this binary please
#--------------------------------------------------
"$DIR/__relativepathtobin__" "$@"
If we really want to, we can have Batch, Python and Julia within one script, and tell Linux to run it as Python. It would feel strange to run a .bat extension in linux, but it works :P
#!/usr/bin/env python
"""
clear
:: ========== Batch part ==========
@echo off
echo Hello world from bat
python "%~0"
julia "%~0"
exit /b
"""
#=
# ========== Python part ==========
print("Hello world from Python")
"""
=#
# ========== Julia part ==========
print("Hello world from Julia")
# """
This is implemented, but not in main branch yet. There are also still some bugs to fix.
I removed all the linux parts for now untill I can focus on adding a proper linux implimentation
MacOS support will be great as well.
Maybe use PowerShell to support them all?
Since I've been able to only sparsely maintaining this project, I'm scaling back on extra features to rather focus on GitHub actions with a continual release cycle. Since I don't have a Mac, and since I don't have a linux port yet (which I think would be the first step for cross-platform use) I'm not going to put work into an MacOS release.
Once you have something for Linux I'd be happy to try helping on the macOS front. Though, have you thought about using PowerShell? It might maje things easier for multi OS support, no?