Skip to content

Instantly share code, notes, and snippets.

@colinbellino
Created January 8, 2024 22:58
Show Gist options
  • Save colinbellino/1ab9605e3b87d4cf25d4009620d5fba5 to your computer and use it in GitHub Desktop.
Save colinbellino/1ab9605e3b87d4cf25d4009620d5fba5 to your computer and use it in GitHub Desktop.
Quick way to replace the version in project.godot file
using System;
using System.IO;
// Build and run: `csc.exe /out:godot_build.exe /target:exe godot_build.cs && ./godot_build.exe`
public class Bar {
static void Main(string[] args) {
var version = "9.9.9";
var file_path = "project.godot";
var lines = File.ReadAllLines(file_path);
for (int i = 0; i < lines.Length; i += 1) {
if (lines[i].StartsWith("config/version")) {
var previous_value = lines[i];
lines[i] = String.Format("config/version=\"{0}\"", version);
Console.WriteLine(String.Format("{0} -> {1}", previous_value, lines[i]));
}
}
File.WriteAllLines(file_path, lines);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment