git fixed

This commit is contained in:
leedongmyung[desktop] 2023-11-25 13:50:13 +09:00
parent eeeb1b8b85
commit 8ba2633286
4 changed files with 20 additions and 11 deletions

View file

@ -20,10 +20,10 @@ class BuildDart extends Command {
var workspace = getWorkspace(data.workspace);
var shell = StringBuffer('cd $workspace');
shell.write('&& flutter clean');
shell.write('&& flutter pub upgrade --major-versions');
shell.write('&& flutter packages upgrade');
shell.write('&& flutter pub get');
shell.write(' && flutter clean');
shell.write(' && flutter pub upgrade --major-versions');
shell.write(' && flutter packages upgrade');
shell.write(' && flutter pub get');
if (data.executeBuildRunner == null ? true : data.executeBuildRunner!) {
shell.write(
' && flutter pub run build_runner build --delete-conflicting-outputs');

View file

@ -1,10 +1,8 @@
import 'dart:async';
import 'package:oto_cli/oto/application.dart';
import 'package:oto_cli/oto/commands/command.dart';
import 'package:oto_cli/oto/data/command_data.dart';
import 'package:dart_framework/platform/process.dart';
import 'package:dart_framework/utils/path.dart';
class BuildiOS extends Command {
Function? get error => null;

View file

@ -1,6 +1,6 @@
// ignore_for_file: constant_identifier_names
import 'dart:async';
import 'dart:io';
import 'package:dart_framework/utils/path.dart';
import 'package:dart_framework/utils/system_util.dart';
import 'package:oto_cli/oto/application.dart';
@ -22,6 +22,7 @@ import 'package:oto_cli/oto/commands/util/publish_ios.dart';
import 'package:oto_cli/oto/commands/util/slack.dart';
import 'package:oto_cli/oto/commands/util/zip.dart';
import 'package:oto_cli/oto/commands/uploader/uploader.dart';
import 'package:path/path.dart' as pathlib;
enum CommandType {
SimpleCommand,
@ -134,7 +135,11 @@ abstract class Command {
}
String getWorkspace(String? dataWorkspace) {
return getPathNormal(dataWorkspace ?? jenkinsData!.workspace);
var path = getPathNormal(dataWorkspace ?? jenkinsData!.workspace);
if (path == '.' || path.startsWith('./')) {
path = path.replaceFirst('.', getPathNormal(pathlib.current));
}
return path;
}
String getPathNormal(String path) {

View file

@ -1,4 +1,4 @@
import 'dart:async';
import 'dart:io';
import 'package:oto_cli/oto/commands/command.dart';
import 'package:oto_cli/oto/data/command_data.dart';
@ -10,10 +10,16 @@ class Git extends Command {
var data = DataGit.fromJson(command.param);
var workspace = getWorkspace(data.workspace);
var shell = StringBuffer('cd $workspace\n');
String drive = '';
if (Platform.isWindows) {
drive = '${workspace[0]}: && ';
}
var shell = StringBuffer(drive);
shell.write('cd $workspace');
var commands = data.commands;
for (var item in commands) {
shell.writeln('git ${getPathNormal(item)}');
shell.write(' && git ${getPathNormal(item)}');
}
var process = await ProcessExecutor.start(shell);