Class: Fastlane::Actions::HgEnsureCleanStatusAction
Overview
Raises an exception and stop the lane execution if the repo is not in a clean state
Constant Summary
Fastlane::Action::AVAILABLE_CATEGORIES, Fastlane::Action::RETURN_TYPES
Class Method Summary
collapse
action_name, authors, available_options, deprecated_notes, lane_context, method_missing, other_action, return_type, return_value, sample_return_value, shell_out_should_use_bundle_exec?, step_text
Class Method Details
.author ⇒ Object
33
34
35
36
|
# File 'fastlane/lib/fastlane/actions/hg_ensure_clean_status.rb', line 33
def self.author
"sjrmanning"
end
|
.category ⇒ Object
48
49
50
|
# File 'fastlane/lib/fastlane/actions/hg_ensure_clean_status.rb', line 48
def self.category
:source_control
end
|
.description ⇒ Object
19
20
21
|
# File 'fastlane/lib/fastlane/actions/hg_ensure_clean_status.rb', line 19
def self.description
"Raises an exception if there are uncommitted hg changes"
end
|
.details ⇒ Object
23
24
25
|
# File 'fastlane/lib/fastlane/actions/hg_ensure_clean_status.rb', line 23
def self.details
"Along the same lines as the [ensure_git_status_clean](https://docs.fastlane.tools/actions/ensure_git_status_clean/) action, this is a sanity check to ensure the working mercurial repo is clean. Especially useful to put at the beginning of your Fastfile in the `before_all` block."
end
|
.example_code ⇒ Object
42
43
44
45
46
|
# File 'fastlane/lib/fastlane/actions/hg_ensure_clean_status.rb', line 42
def self.example_code
[
'hg_ensure_clean_status'
]
end
|
.is_supported?(platform) ⇒ Boolean
38
39
40
|
# File 'fastlane/lib/fastlane/actions/hg_ensure_clean_status.rb', line 38
def self.is_supported?(platform)
true
end
|
.output ⇒ Object
27
28
29
30
31
|
# File 'fastlane/lib/fastlane/actions/hg_ensure_clean_status.rb', line 27
def self.output
[
['HG_REPO_WAS_CLEAN_ON_START', 'Stores the fact that the hg repo was clean at some point']
]
end
|
.run(params) ⇒ Object
8
9
10
11
12
13
14
15
16
17
|
# File 'fastlane/lib/fastlane/actions/hg_ensure_clean_status.rb', line 8
def self.run(params)
repo_clean = `hg status`.empty?
if repo_clean
UI.success('Mercurial status is clean, all good! 😎')
Actions.lane_context[SharedValues::HG_REPO_WAS_CLEAN_ON_START] = true
else
UI.user_error!('Mercurial repository is dirty! Please ensure the repo is in a clean state by committing/stashing/discarding all changes first.')
end
end
|