-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #8 from Friends-of-Monika/dev
Release 1.1.8
- Loading branch information
Showing
7 changed files
with
93 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
/.vscode | ||
/*.zip | ||
/build | ||
.DS_Store |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,38 @@ | ||
' This is Windows-specific VBScript file used for creating or checking shortcut | ||
' in autostart folder without a need to add winshell/pywin32 dependencies. | ||
' The script must be invoked with three positional parameters: | ||
' 0: shortcut path (must contain filename ending with .lnk) | ||
' 1: target executable path | ||
' 2: executable working directory | ||
' If only one positional parameter is passed (shortcut path), its target | ||
' is written to standard output stream. | ||
' The script must be invoked with the following parameters: | ||
' For shortcut creation: | ||
' 0: constant value of "create", a subcommand | ||
' 1: shortcut path (must contain filename ending with .lnk) | ||
' 2: target executable path | ||
' 3: executable working directory | ||
' For shortcut path checking: | ||
' 0: constant value of "check", a subcommand | ||
' 1: file to write output to | ||
' 2: path to check shortcut path of | ||
|
||
' Adopted and reworked from https://superuser.com/a/392082. | ||
' Huge thanks to original answer author for saving us lots of time | ||
' we could instead waste on messing with winshell/pywin32. | ||
|
||
Set Shell = WScript.CreateObject("WScript.Shell") | ||
Set Shortcut = Shell.CreateShortcut(WScript.Arguments(0)) | ||
|
||
If WScript.Arguments.Length = 3 Then | ||
Shortcut.TargetPath = WScript.Arguments(1) | ||
Shortcut.WorkingDirectory = WScript.Arguments(2) | ||
If WScript.Arguments(0) = "create" Then | ||
' Create a shortcut object for parameter 1 with target path as parameter 2 | ||
' and working directory as parameter 3. | ||
Set Shortcut = Shell.CreateShortcut(WScript.Arguments(1)) | ||
Shortcut.TargetPath = WScript.Arguments(2) | ||
Shortcut.WorkingDirectory = WScript.Arguments(3) | ||
Shortcut.Save | ||
|
||
Else | ||
WScript.Echo Shortcut.TargetPath | ||
ElseIf WScript.Arguments(0) = "check" Then | ||
Set FileSystem = WScript.CreateObject("Scripting.FileSystemObject") | ||
Const MODE_WRITE = 2 | ||
|
||
' Open output file for parameter 1 for writing to write shortcut for | ||
' parameter 2 target path to. | ||
Set OutputStream = FileSystem.CreateTextFile(WScript.Arguments(1), MODE_WRITE) | ||
Set Shortcut = Shell.CreateShortcut(WScript.Arguments(2)) | ||
OutputStream.WriteLine(Shortcut.TargetPath) | ||
|
||
End If |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
#!/bin/pwsh | ||
|
||
function New-TemporaryDirectory { | ||
$parent = [System.IO.Path]::GetTempPath() | ||
$name = [System.IO.Path]::GetRandomFileName() | ||
New-Item -ItemType Directory -Path (Join-Path $parent $name) | ||
} | ||
|
||
$Dir = Split-Path -Parent (Split-Path -Parent $MyInvocation.MyCommand.Definition) | ||
$Temp = New-TemporaryDirectory | ||
|
||
$Build = "$Dir\build" | ||
New-Item -ItemType Directory -Force -Path $Build | Out-Null | ||
|
||
$Name = Get-Content $Dir\mod\aa_header.rpy | Select-String '^\s*name="([^"]+)"' | ForEach-Object { $_.Matches[0].Groups[1].Value } | ||
$Version = Get-Content $Dir\mod\aa_header.rpy | Select-String '^\s*version="([^"]+)"' | ForEach-Object { $_.Matches[0].Groups[1].Value } | ||
$Package = $Name.ToLower() -Replace "\s", "-" | ||
|
||
$Mod = "$Temp\game\Submods" | ||
New-Item -ItemType Directory -Force -Path $Mod | Out-Null | ||
$Mod = "$Mod\$Name" | ||
|
||
Copy-Item -Recurse $Dir\mod $Mod | ||
|
||
Compress-Archive -Update -Path $Temp\game -DestinationPath $Build\$Package-$Version.zip | ||
Remove-Item -Recurse $Temp |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,18 @@ | ||
#!/bin/sh | ||
|
||
# Builds a package with the submod. | ||
# Usage: $ scripts/build PACKAGE_NAME | ||
|
||
dir="$(dirname "$(CDPATH="" cd -- "$(dirname -- "$0")" && pwd)")" | ||
temp="$(mktemp -d)" | ||
|
||
mkdir -p "$temp/game/Submods" | ||
cp -r "$dir/mod" "$temp/game/Submods/MAS Autostart Mod" | ||
(cd "$temp" || exit 1; find game | zip -9@ "$dir/$1" && rm -rf "$temp") | ||
build="$dir/build" | ||
mkdir -p "$build" | ||
|
||
name="$(perl -ne 'if (/^.*name="([^"]*)"/) { print $1; exit }' "$dir/mod/aa_header.rpy")" | ||
version="$(perl -ne 'if (/^.*version="([^"]*)"/) { print $1; exit }' "$dir/mod/aa_header.rpy")" | ||
package="$(echo "$name" | tr "[:upper:]" "[:lower:]" | tr "[:blank:]" "-")" | ||
|
||
mod="$temp/game/Submods/$name" | ||
mkdir -p "$mod" | ||
|
||
cp -r "$dir/mod"/* "$mod" | ||
|
||
(cd "$temp" || exit 1; find game | zip -9@q "$build/$package-$version.zip" && rm -rf "$temp") |