Skip to content

Commit

Permalink
Fix build
Browse files Browse the repository at this point in the history
  • Loading branch information
principis committed Jan 8, 2022
1 parent be3244f commit 2fff4b9
Show file tree
Hide file tree
Showing 5 changed files with 36 additions and 36 deletions.
14 changes: 7 additions & 7 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on:
tags:
- 'v*.*.*'
env:
VERSION: $(echo $GITHUB_REF | cut -d'-' -f1 | cut -c12-)
RELEASE_VERSION: $(echo $GITHUB_REF | cut -d'-' -f1 | cut -c12-)

jobs:
build:
Expand All @@ -24,8 +24,8 @@ jobs:
- name: Build tldr-sharp
run: |
nuget restore
msbuild tldr-sharp -t:Rebuild -p:TargetFrameworks=net461 -p:Configuration=Release -p:AllowedReferenceRelatedFileExtensions=none
nuget restore tldr-sharp.sln
msbuild tldr-sharp.sln -t:Rebuild -p:TargetFrameworks=net461 -p:Configuration=Release -p:AllowedReferenceRelatedFileExtensions=none
- name: Cache Build
uses: actions/cache@v2
Expand Down Expand Up @@ -65,8 +65,8 @@ jobs:
run: |
cp -r tldr-sharp/bin/Release/net461 scripts/windows/release
cp scripts/windows/sqlite3.dll scripts/windows/release/
mv scripts/windows/release/net461/tldr-sharp.exe scripts/windows/release/tldr.exe
mv scripts/windows/release/net461/tldr-sharp.exe.config scripts/windows/release/tldr.exe.config
mv scripts/windows/release/tldr-sharp.exe scripts/windows/release/tldr.exe
mv scripts/windows/release/tldr-sharp.exe.config scripts/windows/release/tldr.exe.config
- name: Download EnVar plugin for NSIS
uses: carlosperate/download-file-action@v1.0.3
Expand All @@ -87,7 +87,7 @@ jobs:
run: sudo chown -R $(whoami) /usr/share/nsis/Plugins/

- name: Set tldr-sharp version
run: sed -i "s/VERSION_PLACEHOLDER/${{ env.VERSION }}.0/g" "scripts/windows/install.nsi"
run: sed -i "s/VERSION_PLACEHOLDER/${{ env.RELEASE_VERSION }}.0/g" "scripts/windows/install.nsi"

- name: Create nsis installer
uses: joncloud/makensis-action@v3.3
Expand Down Expand Up @@ -126,7 +126,7 @@ jobs:
install -Dm644 "scripts/debian/control" ".debpkg/DEBIAN/control"
install -Dm755 "scripts/debian/postinst" ".debpkg/DEBIAN/postinst"
install -Dm755 "scripts/debian/prerm" ".debpkg/DEBIAN/prerm"
sed -i "s/VERSION_PLACEHOLDER/${{ env.VERSION }}/g" ".debpkg/DEBIAN/control"
sed -i "s/VERSION_PLACEHOLDER/${{ env.RELEASE_VERSION }}/g" ".debpkg/DEBIAN/control"
- name: Build Debian package
run: fakeroot dpkg-deb --build ".debpkg" "tldr-sharp.deb"
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,8 @@ Reopen powershell and run `tldr`.

* Download the latest [release](https://github.com/principis/tldr-sharp/releases)
* Extract to a folder of choice, for example `C:\ProgramData\tldr-sharp`
* Copy `tldr_sharp.exe` to `tldr.exe`
* Copy `tldr_sharp.exe.config` to `tldr.exe.config`
* Copy `tldr-sharp.exe` to `tldr.exe`
* Copy `tldr-sharp.exe.config` to `tldr.exe.config`
* Add it to the path
* Open Control Panel (old style)
* On the **System** page, click **Advanced system settings** on the left-hand side
Expand Down
44 changes: 22 additions & 22 deletions scripts/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,118 +2,118 @@
set -x
cd tldr-sharp/bin/Release/net461

chmod +x tldr_sharp.exe
chmod +x tldr-sharp.exe

# Test update
mono tldr_sharp.exe -u >/dev/null
mono tldr-sharp.exe -u >/dev/null
if [ $? != 0 ]; then
exit 1
fi
mono tldr_sharp.exe --update >/dev/null
mono tldr-sharp.exe --update >/dev/null
if [ $? != 0 ]; then
exit 1
fi

# Test clear cache
mono tldr_sharp.exe -c >/dev/null
mono tldr-sharp.exe -c >/dev/null
if [ $? != 0 ]; then
exit 1
fi
mono tldr_sharp.exe --clear-cache >/dev/null
mono tldr-sharp.exe --clear-cache >/dev/null
if [ $? != 0 ]; then
exit 1
fi

# Test list
mono tldr_sharp.exe --list >/dev/null
mono tldr-sharp.exe --list >/dev/null
if [ $? != 0 ]; then
exit 1
fi

# Test list-all
mono tldr_sharp.exe -a >/dev/null
mono tldr-sharp.exe -a >/dev/null
if [ $? != 0 ]; then
exit 1
fi
mono tldr_sharp.exe --list-all >/dev/null
mono tldr-sharp.exe --list-all >/dev/null
if [ $? != 0 ]; then
exit 1
fi

mono tldr_sharp.exe tar >/dev/null
mono tldr-sharp.exe tar >/dev/null
if [ $? != 0 ]; then
exit 1
fi

# Test help
mono tldr_sharp.exe -h >/dev/null
mono tldr-sharp.exe -h >/dev/null
if [ $? != 0 ]; then
exit 1
fi
mono tldr_sharp.exe --help >/dev/null
mono tldr-sharp.exe --help >/dev/null
if [ $? != 0 ]; then
exit 1
fi

# Test non-existing command
mono tldr_sharp.exe -x >/dev/null
mono tldr-sharp.exe -x >/dev/null
if [ $? == 0 ]; then
exit 1
fi
mono tldr_sharp.exe --fake >/dev/null
mono tldr-sharp.exe --fake >/dev/null
if [ $? == 0 ]; then
exit 1
fi

# Test page
mono tldr_sharp.exe tar >/dev/null
mono tldr-sharp.exe tar >/dev/null
if [ $? != 0 ]; then
exit 1
fi

# Test non-existing page
mono tldr_sharp.exe giberishdsfsd >/dev/null
mono tldr-sharp.exe giberishdsfsd >/dev/null
if [ $? == 0 ]; then
exit 1
fi

# test os
mono tldr_sharp.exe --platform=linux >/dev/null
mono tldr-sharp.exe --platform=linux >/dev/null
if [ $? != 0 ]; then
exit 1
fi

# Test os non-existing page
mono tldr_sharp.exe giberishdsfsd --platform=linux >/dev/null
mono tldr-sharp.exe giberishdsfsd --platform=linux >/dev/null
if [ $? == 0 ]; then
exit 1
fi

# Test list-languages
mono tldr_sharp.exe --list-languages >/dev/null
mono tldr-sharp.exe --list-languages >/dev/null
if [ $? != 0 ]; then
exit 1
fi

# Test list-os
mono tldr_sharp.exe --list-os >/dev/null
mono tldr-sharp.exe --list-os >/dev/null
if [ $? != 0 ]; then
exit 1
fi

# Test version
mono tldr_sharp.exe -v >/dev/null
mono tldr-sharp.exe -v >/dev/null
if [ $? != 0 ]; then
exit 1
fi

# Test search
mono tldr_sharp.exe -s tar >/dev/null
mono tldr-sharp.exe -s tar >/dev/null
if [ $? != 0 ]; then
exit 1
fi

mono tldr_sharp.exe -s giberishdsfsd >/dev/null
mono tldr-sharp.exe -s giberishdsfsd >/dev/null
if [ $? == 0 ]; then
exit 1
fi
8 changes: 4 additions & 4 deletions scripts/windows_install.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -64,11 +64,11 @@ Copy-Item -Path "$tempDir\*" -Destination $tldrPath
Remove-Item -Path $tempDir -Recurse -Force

if (([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator)) {
New-Item -ItemType SymbolicLink -Target "$tldrPath\tldr_sharp.exe" -Path "$tldrPath/tldr.exe"
New-Item -ItemType SymbolicLink -Target "$tldrPath\tldr_sharp.exe.config" -Path "$tldrPath/tldr.exe.config"
New-Item -ItemType SymbolicLink -Target "$tldrPath\tldr-sharp.exe" -Path "$tldrPath/tldr.exe"
New-Item -ItemType SymbolicLink -Target "$tldrPath\tldr-sharp.exe.config" -Path "$tldrPath/tldr.exe.config"
} else {
Copy-Item -Path "$tldrPath\tldr_sharp.exe" -Destination "$tldrPath\tldr.exe"
Copy-Item -Path "$tldrPath\tldr_sharp.exe.config" -Destination "$tldrPath\tldr.exe.config"
Copy-Item -Path "$tldrPath\tldr-sharp.exe" -Destination "$tldrPath\tldr.exe"
Copy-Item -Path "$tldrPath\tldr-sharp.exe.config" -Destination "$tldrPath\tldr.exe.config"
}

if ($($env:Path).ToLower().Contains($($tldrPath).ToLower()) -eq $false) {
Expand Down
2 changes: 1 addition & 1 deletion tldr
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
#!/bin/sh
/usr/bin/mono /usr/local/lib/tldr/tldr_sharp.exe "$@"
/usr/bin/mono /usr/local/lib/tldr/tldr-sharp.exe "$@"

0 comments on commit 2fff4b9

Please sign in to comment.