forked from zamronypj/fano-cli
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add capability to skip domain name in /etc/hosts
- Loading branch information
Showing
8 changed files
with
101 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
52 changes: 52 additions & 0 deletions
52
src/Tasks/Implementations/Deploy/Core/WithSkipEtcHostTaskImpl.pas
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
(*!------------------------------------------------------------ | ||
* Fano CLI Application (https://fanoframework.github.io) | ||
* | ||
* @link https://github.com/fanoframework/fano-cli | ||
* @copyright Copyright (c) 2018 - 2020 Zamrony P. Juhara | ||
* @license https://github.com/fanoframework/fano-cli/blob/master/LICENSE (MIT) | ||
*------------------------------------------------------------- *) | ||
unit WithSkipEtcHostTaskImpl; | ||
|
||
interface | ||
|
||
{$MODE OBJFPC} | ||
{$H+} | ||
|
||
uses | ||
|
||
TaskOptionsIntf, | ||
TaskIntf, | ||
ConditionalCompositeTaskImpl; | ||
|
||
type | ||
|
||
(*!-------------------------------------- | ||
* Task that run first task if --skip-etc-hosts | ||
* parameter to skip domain entry creation | ||
* in /etc/hosts or second task if default behavior | ||
*---------------------------------------- | ||
* @author Zamrony P. Juhara <zamronypj@yahoo.com> | ||
*---------------------------------------*) | ||
TWithSkipEtcHostTask = class(TConditionalCompositeTask) | ||
protected | ||
function condition( | ||
const opt : ITaskOptions; | ||
const longOpt : shortstring | ||
) : boolean; override; | ||
end; | ||
|
||
implementation | ||
|
||
uses | ||
|
||
sysutils; | ||
|
||
function TWithSkipEtcHostTask.condition( | ||
const opt : ITaskOptions; | ||
const longOpt : shortstring | ||
) : boolean; | ||
var routeMethods : TStringArray; | ||
begin | ||
result := opt.hasOption('skip-etc-hosts'); | ||
end; | ||
end. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters