-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.just
98 lines (68 loc) · 2.06 KB
/
main.just
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
# aia/main.just
#
# Support man pages with ...
# gem install kramdown-man versionaire
#
RR := env_var('RR')
version_filepath := env_var('RR') + "/.version"
man_filepath := env_var('RR') + "/man/aia.1.md"
with ~/.justfile
# FIXME: justprep module process still has an issue with ~ and $HOME
# FIXME: justprep does not like more than one space between module name and path.
module repo /Users/dewayne/sandbox/git_repos/repo.just
module gem /Users/dewayne/sandbox/git_repos/gem.just
module version /Users/dewayne/just_modules/version_versionaire.just
module git /Users/dewayne/just_modules/git.just
# Install Locally
install: update_toc_in_readmen create_man_page flay
rake install
# Create the TOC
update_toc_in_readmen:
rake toc
# Preview man page
preview_man_page:
kramdown-man {{RR}}/man/aia.1.md
# Static Code Check
flay: coverage
flay {{RR}}
# View coverage report
coverage: test
open {{RR}}/coverage/index.html
# Run Unit Tests
test:
rake test
# View man page
view_man_page: create_man_page
man {{RR}}/man/aia.1
# Create man page
create_man_page:
rake man
# Generate the Documentation
gen_doc: create_man_page update_toc_in_readmen
##########################################
# Tag the current commit, push it, then bump the version
tag_push_and_bump: tag push bump
# Create a git tag for the current version
tag:
git tag v`head -1 {{version_filepath}}`
# Push the git current working directory and all tags
push:
git push
git push origin --tags
alias inc := bump
# Increment version's level: major.minor.patch
@bump level='patch':
#!/usr/bin/env ruby
require 'versionaire'
old_version = Versionaire::Version File.read("{{version_filepath}}").strip
level = "{{level}}".to_sym
new_version = old_version.bump level
puts "Bumping #{level}: #{old_version} to #{new_version}"
File.open("{{version_filepath}}", 'w')
.write(new_version.to_s + "\n")
#
content = File.read({{man_filepath}}).sub(old_version, new_version)
#
File.write({{man_filepath}}, content)
#
`git add {{version_filepath}} {{man_filepath}}`