lehrkraefte:blc:informatik:glf4-24:bash-install

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
lehrkraefte:blc:informatik:glf4-24:bash-install [2024/02/16 08:44]
Ivo Blöchliger [Aliases für python und notepad]
lehrkraefte:blc:informatik:glf4-24:bash-install [2024/04/03 09:23] (current)
Ivo Blöchliger [Automatisches Setup]
Line 30: Line 30:
   * Von jetzt an startet das Kommando ''notepad'' den etwas besseren Editor Notepad++.   * Von jetzt an startet das Kommando ''notepad'' den etwas besseren Editor Notepad++.
  
 +
 +===== Automatisches Setup der Datei .bashrc =====
 +Laden Sie die Datei {{lehrkraefte:blc:informatik:glf4-24:setup-aliases.bash}} herunter und führen Sie diese wie folgt aus (nachdem Sie ins Verzeichnis navigieren, wo Sie die Datei gespeichert haben:
 +<code bash>
 +cd /h/Downloads
 +bash setup-aliases.bash
 +</code>
 +
 +====== Automatisches Setup ======
 +<code powershell ofi-setup.ps1>
 +New-Item c:\ofi -ItemType Directory -ea 0
 +if (!(Test-Path C:\ofi\PortableGit\git-bash.exe)) {
 +        if (!(Test-Path c:\ofi\PortableGit.7z.exe)) {
 +                echo "Please wait while downloading..."
 +         Invoke-WebRequest -Uri "https://github.com/git-for-windows/git/releases/download/v2.44.0.windows.1/PortableGit-2.44.0-64-bit.7z.exe" -OutFile c:\ofi\PortableGit.7z.exe
 +        } else {
 +                echo "Portable git Installer is already downloaded"
 +        }
 +
 +        echo "Please click OK to install Git-Bash"
 + cd c:\ofi
 + Invoke-Expression .\PortableGit.7z.exe
 +} else {
 +        echo "Git Bash already installed!"
 +}
 +if (!(Test-Path "$env:USERPROFILE\.bashrc")) {
 + echo "alias notepad='/c/Program Files/Notepad++/notepad++.exe'" | out-file "$env:USERPROFILE\.bashrc" -encoding ASCII
 + echo "alias python='winpty /c/Programme/Anaconda/python.exe'"  | out-file "$env:USERPROFILE\.bashrc" -encoding ASCII -Append
 +        echo "Created .bashrc with aliases for notepad and python"
 +} else {
 +        echo "~/.bashrc already exists, not touching it..."
 +}
 +Invoke-Expression C:\ofi\PortableGit\git-bash.exe
 +
 +</code>
  • lehrkraefte/blc/informatik/glf4-24/bash-install.1708069486.txt.gz
  • Last modified: 2024/02/16 08:44
  • by Ivo Blöchliger