git pull 추가
This commit is contained in:
parent
249dc14aef
commit
46c3729e2d
4 changed files with 51 additions and 0 deletions
|
|
@ -94,6 +94,7 @@ enum CommandType {
|
|||
ShellFile,
|
||||
Git,
|
||||
GitCommit,
|
||||
GitPull,
|
||||
GitPush,
|
||||
GitCheckout,
|
||||
GitRev,
|
||||
|
|
@ -171,6 +172,7 @@ abstract class Command {
|
|||
CommandType.ShellFile: () => ShellFile(),
|
||||
CommandType.Git: () => Git(),
|
||||
CommandType.GitCommit: () => GitCommit(),
|
||||
CommandType.GitPull: () => GitPull(),
|
||||
CommandType.GitPush: () => GitPush(),
|
||||
CommandType.GitCheckout: () => GitCheckout(),
|
||||
CommandType.GitRev: () => GitRev(),
|
||||
|
|
|
|||
|
|
@ -47,6 +47,21 @@ class GitCommit extends Command {
|
|||
}
|
||||
}
|
||||
|
||||
class GitPull extends Command {
|
||||
@override
|
||||
Future execute(DataCommand command) async {
|
||||
var data = DataGitPush.fromJson(getParam(command));
|
||||
|
||||
var shell = StringBuffer(getCDPath(workspace));
|
||||
shell.write(' $and git pull origin ${data.branch}');
|
||||
|
||||
var process =
|
||||
await ProcessExecutor.start(shell, logHandler: Application.logWithType);
|
||||
return await completeProcess(process, command,
|
||||
passExitCodes: [1 /*Everything up-to-date*/]);
|
||||
}
|
||||
}
|
||||
|
||||
//무시가가능한 에러 무시
|
||||
class GitPush extends Command {
|
||||
@override
|
||||
|
|
|
|||
|
|
@ -753,6 +753,19 @@ class BranchInfo {
|
|||
Map<String, dynamic> toJson() => _$BranchInfoToJson(this);
|
||||
}
|
||||
|
||||
//GitPull
|
||||
@JsonSerializable()
|
||||
class DataGitPull extends DataParam {
|
||||
DataGitPull();
|
||||
|
||||
late String branch;
|
||||
|
||||
factory DataGitPull.fromJson(Map<String, dynamic> json) =>
|
||||
_$DataGitPullFromJson(json);
|
||||
@override
|
||||
Map<String, dynamic> toJson() => _$DataGitPullToJson(this);
|
||||
}
|
||||
|
||||
//GitPush
|
||||
@JsonSerializable()
|
||||
class DataGitPush extends DataParam {
|
||||
|
|
|
|||
|
|
@ -99,6 +99,7 @@ const _$CommandTypeEnumMap = {
|
|||
CommandType.ShellFile: 'ShellFile',
|
||||
CommandType.Git: 'Git',
|
||||
CommandType.GitCommit: 'GitCommit',
|
||||
CommandType.GitPull: 'GitPull',
|
||||
CommandType.GitPush: 'GitPush',
|
||||
CommandType.GitCheckout: 'GitCheckout',
|
||||
CommandType.GitRev: 'GitRev',
|
||||
|
|
@ -1320,6 +1321,26 @@ Map<String, dynamic> _$BranchInfoToJson(BranchInfo instance) =>
|
|||
'date': instance.date,
|
||||
};
|
||||
|
||||
DataGitPull _$DataGitPullFromJson(Map<String, dynamic> json) => DataGitPull()
|
||||
..workspace = json['workspace'] as String?
|
||||
..passExitCodes = (json['passExitCodes'] as List<dynamic>?)
|
||||
?.map((e) => (e as num).toInt())
|
||||
.toList()
|
||||
..setResult = json['setResult'] as String?
|
||||
..setExitCode = json['setExitCode'] as String?
|
||||
..showPrint = json['showPrint'] as bool?
|
||||
..branch = json['branch'] as String;
|
||||
|
||||
Map<String, dynamic> _$DataGitPullToJson(DataGitPull instance) =>
|
||||
<String, dynamic>{
|
||||
'workspace': instance.workspace,
|
||||
'passExitCodes': instance.passExitCodes,
|
||||
'setResult': instance.setResult,
|
||||
'setExitCode': instance.setExitCode,
|
||||
'showPrint': instance.showPrint,
|
||||
'branch': instance.branch,
|
||||
};
|
||||
|
||||
DataGitPush _$DataGitPushFromJson(Map<String, dynamic> json) => DataGitPush()
|
||||
..workspace = json['workspace'] as String?
|
||||
..passExitCodes = (json['passExitCodes'] as List<dynamic>?)
|
||||
|
|
|
|||
Loading…
Reference in a new issue