Skip to content
This repository has been archived by the owner on Dec 3, 2024. It is now read-only.

Commit

Permalink
hemtt stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
OverlordZorn committed Nov 18, 2024
1 parent 337c831 commit 2ec0fe7
Show file tree
Hide file tree
Showing 12 changed files with 107 additions and 0 deletions.
1 change: 1 addition & 0 deletions .hemtt/hooks/post_build/post_build.rhai
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
HEMTT.script("update_3_build");
1 change: 1 addition & 0 deletions .hemtt/hooks/post_release/post_release.rhai
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
HEMTT.script("update_1_minor");
3 changes: 3 additions & 0 deletions .hemtt/scripts copy/bump_0_major.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
cd ..
cd ..
hemtt script update_major.rhai
3 changes: 3 additions & 0 deletions .hemtt/scripts copy/bump_1_minor.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
cd ..
cd ..
hemtt script update_minor.rhai
3 changes: 3 additions & 0 deletions .hemtt/scripts copy/bump_2_patch.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
cd ..
cd ..
hemtt script update_patch.rhai
3 changes: 3 additions & 0 deletions .hemtt/scripts copy/bump_3_build.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
cd ..
cd ..
hemtt script update_build.rhai
29 changes: 29 additions & 0 deletions .hemtt/scripts copy/update_0_major.rhai
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
// Read the current contents of script_version.hpp
let script_version = HEMTT_RFS.join("addons")
.join("main")
.join("script_version.hpp")
.open_file()
.read();

// Replace the current version with the new version
let prefix = "#define MAJOR ";
let current = HEMTT.project().version().major();
let next = current + 1;
script_version.replace("#define MAJOR " + current.to_string(),"#define MAJOR " + next.to_string());

print(script_version);

// Updating major version should reset minor number
current = HEMTT.project().version().minor();
script_version.replace("#define MINOR " + current.to_string(), "#define MINOR 0");

// Updating minor version should reset patch number
current = HEMTT.project().version().patch();
script_version.replace("#define PATCH " + current.to_string(), "#define PATCH 0");

// Write the modified contents to script_version.hpp
HEMTT_RFS.join("addons")
.join("main")
.join("script_version.hpp")
.create_file()
.write(script_version);
24 changes: 24 additions & 0 deletions .hemtt/scripts copy/update_1_minor.rhai
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
// Read the current contents of script_version.hpp
let script_version = HEMTT_RFS.join("addons")
.join("main")
.join("script_version.hpp")
.open_file()
.read();

// Replace the current version with the new version
let prefix = "#define MINOR ";
let current = HEMTT.project().version().minor();
let next = current + 1;

script_version.replace(prefix + current.to_string(), prefix + next.to_string());

// Updating minor version should reset patch number
current = HEMTT.project().version().patch();
script_version.replace("#define PATCH " + current.to_string(), "#define PATCH 0");

// Write the modified contents to script_version.hpp
HEMTT_RFS.join("addons")
.join("main")
.join("script_version.hpp")
.create_file()
.write(script_version);
21 changes: 21 additions & 0 deletions .hemtt/scripts copy/update_2_patch.rhai
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
// Read the current contents of script_version.hpp
let script_version = HEMTT_RFS.join("addons")
.join("main")
.join("script_version.hpp")
.open_file()
.read();

// Replace the current version with the new version
let prefix = "#define PATCH ";
let current = HEMTT.project().version().patch();
let next = current + 1;

script_version.replace(prefix + current.to_string(), prefix + next.to_string());


// Write the modified contents to script_version.hpp
HEMTT_RFS.join("addons")
.join("main")
.join("script_version.hpp")
.create_file()
.write(script_version);
19 changes: 19 additions & 0 deletions .hemtt/scripts copy/update_3_build.rhai
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
// Read the current contents of script_version.hpp
let script_version = HEMTT_RFS.join("addons")
.join("main")
.join("script_version.hpp")
.open_file()
.read();

// Replace the current version with the new version
let prefix = "#define BUILD ";
let current = HEMTT.project().version().build();
let next = current + 1;
script_version.replace(prefix + current.to_string(), prefix + next.to_string());

// Write the modified contents to script_version.hpp
HEMTT_RFS.join("addons")
.join("main")
.join("script_version.hpp")
.create_file()
.write(script_version);

0 comments on commit 2ec0fe7

Please sign in to comment.