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

VSCode setup #2

Open
wants to merge 16 commits into
base: main
Choose a base branch
from
Open

VSCode setup #2

wants to merge 16 commits into from

Conversation

ProphetLamb
Copy link
Contributor

  1. Fügt Einstellungen und empfohlene Extensions für VSCode hinzu, mit dem Ziel das Schreiben zu erleichtern und 3rd party Tools zu integrieren.
  2. Erstellt setup.ps1 ein Skript, mit dem automatisch unter Windows alle nötigen Programme installiert werden können.

Copy link
Owner

@Siphalor Siphalor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, there's a lot to say about this PR:

  • First off, I'm in general not sure if editor specific config files should be added to this repository, especially when they are at this level of complexity (multiple files JSON files, over one hundred lines).
  • Replacing Scoop with Chocolatey is completely out of scope for this PR.
    Apart from that I'd like to hear you're reasoning for these changes. In general, I prefer Scoop as it doesn't require administrative rights and usually offers a smoother user experience.
  • About SVGs: These are too out of scope.
    Apart from that, I'd like to mention that including vector graphics through the use of PDF files is already entirely possible out of the box.
    I am not sure if the average user will find the necessity to use SVG files for vector images instead, as most popular vector image software offers exports to PDF as well.
  • For the text changes, I haven't even started correcting grammar and spelling issues - Just to mention at a quick glance I saw a lot of them.

Comment on lines +101 to 126
Als Package Manager wird Chocolatey genutzt, da diese einfache Installationen und Updates ermöglichen.
Eine Shell mit Administrativen rechten wird benötigt! Diese kann mit [Win]+[X], [A] geöffnet werden.
```pwsh
Set-ExecutionPolicy RemoteSigned -Scope CurrentUser
irm get.scoop.sh | iex
irm https://get.scoop.sh | iex
irm https://community.chocolatey.org/install.ps1 | iex
choco feature enable -n=allowGlobalConfirmation
```
`allowGlobalConfirmation` schaltet Rückfragen bei der installation ab.

Zunächst wird die VCS `git` installiert:
```pwsh
choco install git
```

Weiterhin wird `pip` benötigt um die Python-basierten Extensions zu installieren:
```pwsh
scoop install python
choco install python.install
python -m ensurepip
```

Nun benötigen wir noch den `make` command aus den GNU coreutils.
Hier kann beispielsweise die Rust-Implementierung dieser Tools verwendet werden:
Hierzu werden alle GNU coreutils installiert:
```pwsh
scoop install uutils-coreutils
choco install gnuwin32-coreutils.install
```
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why does this PR, that is meant to be about VSCode, change the Windows setup to using Chocolatey?

If Chocolatey should be preferred over Scoop is a whole different debate and shouldn't be in this PR.

pip install pandoc-include --user
```

Der Python installer für Pandoc Acronyms fügt keinen PATH Eintrag hinzu, dessalb verwenden wir den offiziellen installer
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This depends a lot on the Python installer that has been used; in all normal Windows Python installations the main scripts directory is added to the PATH.

Comment on lines +187 to +191
[SVG](https://developer.mozilla.org/en-US/docs/Web/SVG) können mit GNOME `librsvg` Eingebettet werden. Die Library ist auf einigen Distos bereits installiert, ansonsten muss die Library bezogen werden.
```pwsh
brew install librsvg
```

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Again, SVGs are completely out of scope for this PR too.

Comment on lines +1 to +71
if ((New-Object Security.Principal.WindowsPrincipal([Security.Principal.WindowsIdentity]::GetCurrent())).IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator)) {
Write-Host "Skript hat bereits Administratorrechte."
}
else {
# Starte das skript neu, als Administrator.
Write-Host "Evaluate rights..."
$process = New-Object System.Diagnostics.ProcessStartInfo "powershell"
$process.Arguments = $myInvocation.MyCommand.Definition;
$process.Verb = "runas";
[System.Diagnostics.Process]::Start($process)
exit
}

function test-cmd($command) {
return Get-Command $command -errorAction SilentlyContinue
}

# install choco
if (!(test-cmd "choco")) {
Write-Host "choco is not installed. Installing now..." -ForegroundColor Yellow
Set-ExecutionPolicy RemoteSigned -Scope CurrentUser
(irm https://community.chocolatey.org/install.ps1 | iex) || exit 1
choco feature enable -n=allowGlobalConfirmation
}

# install git
if (!(test-cmd "git")) {
Write-Host "git is not installed. Installing now..." -ForegroundColor Yellow
choco install git || exit 1
}

# install pyhton
if (!(test-cmd "python")) {
Write-Host "python and pip are not installed. Installing now..." -ForegroundColor Yellow
choco install python.install
python -m ensurepip
}

# install make
if (!(test-cmd "make")) {
Write-Host "make is not installed. Installing now..." -ForegroundColor Yellow
choco install gnuwin32-coreutils.install
}

# install pdflatex
if (!(test-cmd "pdflatex")) {
Write-Host "pdflatex not found. Installing MikTex now..." -ForegroundColor Yellow
choco install miktex --params "\ThisUser"
Write-Host "Remember to update MikTex dependencies!" -ForegroundColor Yellow
}

# install pandoc
if (!(test-cmd "pandoc")) {
Write-Host "pandoc not found. Installing pandoc and extensions now..." -ForegroundColor Yellow
choco install pandoc pandoc-crossref
pip install pandoc-include --user

Write-Host "Installing pandoc-acro now to ~/apps..."
if (!(test-path ~/apps)) { mkdir -p ~/apps }
pushd ~/apps || exit
git clone https://github.com/kprussing/pandoc-acro.git
pushd pandoc-acro || exit
python setup.py install
popd
popd
}

if (!(choco find --local pandoc)) {
Write-Host "libvirt.dll (SVG support) not found. Installing now..." -ForegroundColor Yellow
choco install rsvg-convert
}
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Apart from being out of the scope of this PR, I'm not a fan of magic Powershell setup scripts, unless they're really necessary.

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.

None yet

2 participants