Skip to content

Commit

Permalink
Merge pull request #62 from maxfierke/mf-set_git_user_details
Browse files Browse the repository at this point in the history
Set git user details via mstrap
  • Loading branch information
maxfierke authored Oct 15, 2024
2 parents b9c4212 + d232ddd commit fd94043
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 11 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ jobs:
run: shards install

- name: Import Developer ID Application cert for signing and notorizing
uses: Apple-Actions/import-codesign-certs@5565bb656f60c98c8fc515f3444dd8db73545dc2
uses: Apple-Actions/import-codesign-certs@63fff01cd422d4b7b855d40ca1e9d34d2de9427d # v3
with:
p12-file-base64: ${{ secrets.APPLE_DEVELOPER_CERTIFICATE_P12_BASE64 }}
p12-password: ${{ secrets.APPLE_DEVELOPER_CERTIFICATE_PASSWORD }}
Expand Down Expand Up @@ -139,7 +139,7 @@ jobs:
run: shards install

- name: Import Developer ID Application cert for signing and notorizing
uses: Apple-Actions/import-codesign-certs@5565bb656f60c98c8fc515f3444dd8db73545dc2
uses: Apple-Actions/import-codesign-certs@63fff01cd422d4b7b855d40ca1e9d34d2de9427d # v3
with:
p12-file-base64: ${{ secrets.APPLE_DEVELOPER_CERTIFICATE_P12_BASE64 }}
p12-password: ${{ secrets.APPLE_DEVELOPER_CERTIFICATE_PASSWORD }}
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,4 @@
*.dwarf
.DS_Store
/vendor/
Makefile.local
6 changes: 4 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@ SHELL := bash
.DELETE_ON_ERROR:
.SUFFIXES:

CODESIGN_IDENTITY ?= 66837B7A624EA4CDB507D40C6940C74A740EF5B1
-include Makefile.local

CODESIGN_IDENTITY ?=
CRFLAGS ?=
CRYSTAL ?= $(shell which crystal)
HOST_ARCH := $(shell uname -m)
Expand Down Expand Up @@ -159,7 +161,7 @@ check-formatting: $(SOURCES)

.PHONY: check-libraries
check-libraries: bin/mstrap
@if [ ! -z "$(STATIC)" ] && [ "$(TARGET_OS)" == "darwin" ] && [ "$$(otool -LX bin/mstrap | awk '{print $$1}')" != "$$(cat expected.libs.darwin)" ]; then \
@if [ ! -z "$(STATIC)" ] && [ "$(TARGET_OS)" == "darwin" ] && [ "$$(otool -LX bin/mstrap | awk '{print $$1}' | sort)" != "$$(cat expected.libs.darwin)" ]; then \
echo "FAIL: bin/mstrap has non-allowed dynamic libraries"; \
exit 1; \
else \
Expand Down
2 changes: 1 addition & 1 deletion meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ project('mstrap',
'c',
meson_version : '>= 0.60.0',
license : 'MIT',
version : '0.7.0-dev.2',
version : '0.7.0-dev.3',
default_options : [
'buildtype=debugoptimized',
'default_library=static'
Expand Down
2 changes: 1 addition & 1 deletion shard.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: mstrap
version: 0.7.0-dev.2
version: 0.7.0-dev.3

authors:
- Max Fierke <[email protected]>
Expand Down
13 changes: 8 additions & 5 deletions src/mstrap/steps/dependencies_step.cr
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,19 @@ module MStrap
def bootstrap
install_mise if runtime_managers.any? { |rm| rm.name == "mise" }
install_rustup if runtime_managers.any? { |rm| rm.name == "rustup" }
set_strap_env!
set_git_user!
strap_sh
load_profile!
brew_bundle
end

private def set_strap_env!
ENV["STRAP_GIT_NAME"] = user.name
ENV["STRAP_GIT_EMAIL"] = user.email
ENV["STRAP_GITHUB_USER"] = user.github
private def set_git_user!
log "==> Setting git user details: "
unless cmd("git", "config", "--global", "user.name", user.name, quiet: true) && cmd("git", "config", "--global", "user.email", user.email, quiet: true)
logc "Unable to set git user details. Is git installed?"
end

success "OK"
end

private def strap_sh
Expand Down

0 comments on commit fd94043

Please sign in to comment.