-
Notifications
You must be signed in to change notification settings - Fork 5
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 #96 from geefr/stuff
Merry beatmas
- Loading branch information
Showing
15 changed files
with
104 additions
and
51 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
Submodule BSIPA-Linux
updated
6 files
+1 −1 | .circleci/config.yml | |
+1 −1 | .github/workflows/dotnet.yml | |
+1 −1 | IPA-bin/IPA-bin.csproj | |
+1 −1 | IPA-lib/IPA-lib.csproj | |
+2 −0 | README.md | |
+3 −3 | publish-linux-x64.sh |
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
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
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,26 +1,48 @@ | ||
using System; | ||
using System.IO; | ||
using System.Runtime.InteropServices; | ||
using System.Text; | ||
using System.Text.Json.Serialization; | ||
using System.Text.Json; | ||
|
||
namespace Beataroni.Services | ||
{ | ||
public class Settings | ||
{ | ||
// TODO: Most of these are blank - will be initialised to sensible defaults, | ||
// or need to be setup each time installer is launched. Will need persistent settings | ||
// storage for this. | ||
public string BSVersion {get;set;} = ""; | ||
public string BSInstall {get;set;} = ""; | ||
|
||
public Settings() | ||
private static string SettingsFile = Environment.GetEnvironmentVariable(RuntimeInformation.IsOSPlatform(OSPlatform.Linux) ? "HOME" : "LocalAppData" ) + "/.config/beataroni/config.json"; | ||
|
||
public Settings() {} | ||
|
||
public static Settings Load() | ||
{ | ||
// var vers = BeatModsV1.FetchBSVersions(); | ||
// if( vers.Count != 0 ) BSVersion = vers[0]; | ||
// BSInstall = SearchForBeatSaber(); | ||
try | ||
{ | ||
var confText = File.ReadAllText(SettingsFile, Encoding.UTF8); | ||
return JsonSerializer.Deserialize<Settings>(confText); | ||
} catch(Exception) | ||
{ | ||
return new Settings(); | ||
} | ||
} | ||
|
||
private string SearchForBeatSaber() | ||
public bool Save() | ||
{ | ||
// TODO: | ||
return ""; | ||
try | ||
{ | ||
var confDir = Directory.GetParent(SettingsFile); | ||
if( !confDir.Exists ) | ||
{ | ||
Directory.CreateDirectory(confDir.FullName); | ||
} | ||
var confText = JsonSerializer.Serialize<Settings>(this); | ||
File.WriteAllText(SettingsFile, confText, Encoding.UTF8); | ||
return true; | ||
} catch(Exception) | ||
{ | ||
return false; | ||
} | ||
} | ||
} | ||
} |
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
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,4 +1,4 @@ | ||
#!/usr/bin/env sh | ||
buildDir=$(dirname $0) | ||
dotnet publish /p:PublishProfile=${buildDir}/../Beataroni/Properties/PublishProfiles/Linux64.pubxml | ||
cp ${buildDir}/Beataroni-Linux.sh ${buildDir}/../Beataroni/bin/Release/net5.0/publish-Linux64/ | ||
cp ${buildDir}/Beataroni-Linux.sh ${buildDir}/../Beataroni/bin/Release/net6.0/publish-Linux64/ |
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 @@ | ||
#!/usr/bin/env sh | ||
buildDir=$(dirname $0) | ||
dotnet publish /p:PublishProfile=${buildDir}/../Beataroni/Properties/PublishProfiles/Win64.pubxml |