-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
6f71b88
commit 8ba9e4b
Showing
6 changed files
with
70 additions
and
17 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
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 |
---|---|---|
|
@@ -2,13 +2,15 @@ cabal-version: 3.0 | |
name: HaskMate | ||
version: 0.1.0.0 | ||
-- synopsis: | ||
synopsis: Haskell File Monitor | ||
homepage: https://github.com/Frost-Lord/HaskMate | ||
-- description: | ||
license: MIT | ||
license-file: LICENSE | ||
author: Frost Lord | ||
maintainer: [email protected] | ||
-- copyright: | ||
category: Math | ||
category: System | ||
build-type: Simple | ||
extra-doc-files: CHANGELOG.md | ||
-- extra-source-files: | ||
|
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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,48 @@ | ||
$destinationDir = "$env:APPDATA\Haskmate" | ||
$sourceExe1 = ".\Haskmate.exe" | ||
$sourceExe2 = ".\dist-newstyle\build\x86_64-windows\ghc-9.6.2\HaskMate-0.1.0.0\x\HaskMate\build\HaskMate\Haskmate.exe" | ||
|
||
# Check if Haskmate directory is already in the PATH environment variable | ||
$existingPath = [Environment]::GetEnvironmentVariable("PATH", "User") | ||
$hasHaskmatePath = $existingPath -like "*$destinationDir*" | ||
|
||
# Create the Haskmate directory if it doesn't exist | ||
if (-not (Test-Path $destinationDir)) { | ||
New-Item -ItemType Directory -Path $destinationDir -Force | Out-Null | ||
} | ||
|
||
# Check if Haskmate.exe already exists in the destination directory | ||
$destinationExe = Join-Path -Path $destinationDir -ChildPath "Haskmate.exe" | ||
if (Test-Path $destinationExe) { | ||
Write-Host "Replacing existing Haskmate.exe in the Haskmate directory." | ||
Remove-Item -Path $destinationExe -Force | ||
} | ||
|
||
# Copy the Haskmate executable to the destination directory | ||
$sourcePath = $sourceExe1 | ||
if (-not (Test-Path $sourcePath)) { | ||
Write-Host "Running from development environment." | ||
$sourcePath = $sourceExe2 | ||
} | ||
|
||
if (Test-Path $sourcePath) { | ||
Copy-Item -Path $sourcePath -Destination $destinationExe -Force | ||
} else { | ||
Write-Host "Unable to find the Haskmate.exe file in the expected locations." | ||
Write-Host "Please make sure the Haskmate executable is present and try again." | ||
pause | ||
exit | ||
} | ||
|
||
# Add the Haskmate directory to the PATH environment variable if not already present | ||
if (-not $hasHaskmatePath) { | ||
$newPath = $existingPath + ";" + $destinationDir | ||
[Environment]::SetEnvironmentVariable("PATH", $newPath, "User") | ||
Write-Host "Haskmate directory added to the PATH environment variable." | ||
} | ||
|
||
# Display a message to confirm the setup | ||
Write-Host "Haskmate setup complete." | ||
Write-Host "Haskmate executable is located in: $destinationDir" | ||
Write-Host "You can now run Haskmate from anywhere in the command prompt." | ||
pause |
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,3 @@ | ||
main :: IO () | ||
main = do | ||
putStrLn "My script running!" |