mirror of
https://github.com/KRTirtho/spotube.git
synced 2025-12-09 08:47:31 +00:00
cd: use tar command directly
This commit is contained in:
parent
65db056b0d
commit
28a213831d
@ -5,7 +5,6 @@ import 'package:io/io.dart';
|
|||||||
import 'package:args/command_runner.dart';
|
import 'package:args/command_runner.dart';
|
||||||
import 'package:intl/intl.dart';
|
import 'package:intl/intl.dart';
|
||||||
import 'package:path/path.dart';
|
import 'package:path/path.dart';
|
||||||
import 'package:archive/archive.dart';
|
|
||||||
|
|
||||||
import '../../core/env.dart';
|
import '../../core/env.dart';
|
||||||
import 'common.dart';
|
import 'common.dart';
|
||||||
@ -70,23 +69,9 @@ class LinuxBuildCommand extends Command with BuildCommandCommonSteps {
|
|||||||
join(tempDir, "spotube-logo.png"),
|
join(tempDir, "spotube-logo.png"),
|
||||||
);
|
);
|
||||||
|
|
||||||
final archive = Archive();
|
await shell.run(
|
||||||
|
"tar -cJf ${tarFile.path} -C $tempDir .",
|
||||||
for (final entity in Directory(tempDir).listSync(recursive: true)) {
|
);
|
||||||
if (entity is File) {
|
|
||||||
final fileRelPath = relative(entity.path, from: tempDir);
|
|
||||||
final file = File(entity.path);
|
|
||||||
final fileData = file.readAsBytesSync();
|
|
||||||
archive.addFile(ArchiveFile(fileRelPath, fileData.length, fileData));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// convert to tar.xz
|
|
||||||
final tarEncoder = TarEncoder();
|
|
||||||
final xzEncoder = XZEncoder();
|
|
||||||
final tarXzData = xzEncoder.encode(tarEncoder.encode(archive));
|
|
||||||
|
|
||||||
await tarFile.writeAsBytes(tarXzData);
|
|
||||||
|
|
||||||
final ogDeb = File(
|
final ogDeb = File(
|
||||||
join(
|
join(
|
||||||
|
|||||||
@ -42,7 +42,7 @@ packages:
|
|||||||
source: hosted
|
source: hosted
|
||||||
version: "4.0.1"
|
version: "4.0.1"
|
||||||
archive:
|
archive:
|
||||||
dependency: "direct dev"
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: archive
|
name: archive
|
||||||
sha256: ecf4273855368121b1caed0d10d4513c7241dfc813f7d3c8933b36622ae9b265
|
sha256: ecf4273855368121b1caed0d10d4513c7241dfc813f7d3c8933b36622ae9b265
|
||||||
|
|||||||
@ -147,7 +147,6 @@ dev_dependencies:
|
|||||||
process_run: ^0.14.2
|
process_run: ^0.14.2
|
||||||
xml: ^6.5.0
|
xml: ^6.5.0
|
||||||
io: ^1.0.4
|
io: ^1.0.4
|
||||||
archive: ^3.5.1
|
|
||||||
|
|
||||||
dependency_overrides:
|
dependency_overrides:
|
||||||
uuid: ^4.4.0
|
uuid: ^4.4.0
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user