Skip to content

Instantly share code, notes, and snippets.

@Guiorgy
Created December 9, 2025 16:22
Show Gist options
  • Select an option

  • Save Guiorgy/b5cfb00609d013a4a2e3787da7e39d60 to your computer and use it in GitHub Desktop.

Select an option

Save Guiorgy/b5cfb00609d013a4a2e3787da7e39d60 to your computer and use it in GitHub Desktop.
Build Microsoft Edit while including the current datetime in the about dialog as the build
#!/usr/bin/env bash
# ============================================================================= #
# Copyright © 2025 Guiorgy #
# #
# This program is free software: you can redistribute it and/or modify it under #
# the terms of the GNU General Public License as published by the Free Software #
# Foundation, either version 3 of the License, or (at your option) any later #
# version. #
# #
# This program is distributed in the hope that it will be useful, but WITHOUT #
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS #
# FOR A PARTICULAR PURPOSE. #
# #
# You can see the full GNU General Public License at #
# <https://www.gnu.org/licenses/> for more details. #
# ============================================================================= #
ABOUT_RS='crates/edit/src/bin/edit/draw_menubar.rs'
TIMESTAMP=$(date +"%Y-%m-%d %H:%M:%S %Z")
BUILDTIMESTAMP_LINE='ctx.label("builddate", "Build Timestamp: '"$TIMESTAMP"'"); ctx.attr_overflow(Overflow::TruncateHead); ctx.attr_position(Position::Center);'
if grep -q "builddate" "$ABOUT_RS"; then
sed -i '/"builddate"/c\'"$BUILDTIMESTAMP_LINE" "$ABOUT_RS"
else
BUILDTIMESTAMP_LINE="$BUILDTIMESTAMP_LINE"'\n'
sed -i '/"copyright"/i\'"$BUILDTIMESTAMP_LINE" "$ABOUT_RS"
fi
cargo build --config .cargo/release-nightly.toml --config 'profile.release.debug=0' --release
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment