From 903cc0333c02aed2b625073afa2e48617ea1fcbb Mon Sep 17 00:00:00 2001 From: "leedongmyung(desktop)" Date: Thu, 3 Apr 2025 15:24:02 +0900 Subject: [PATCH] add file info name field --- lib/oto/commands/file/file.dart | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/oto/commands/file/file.dart b/lib/oto/commands/file/file.dart index 01a7858..4057df5 100644 --- a/lib/oto/commands/file/file.dart +++ b/lib/oto/commands/file/file.dart @@ -4,6 +4,7 @@ import 'dart:async'; import 'dart:io'; import 'package:oto_cli/oto/commands/command.dart'; import 'package:oto_cli/oto/data/command_data.dart'; +import 'package:path/path.dart' as path; class FileRead extends Command { @override @@ -76,6 +77,9 @@ class FileInfo extends Command { var stat = await file.stat(); var map = {}; map['path'] = file.path; + map['name'] = path.basename(file.path); + map['withoutExtentionName'] = path.withoutExtension(map['baseName']); + map['extension'] = path.extension(file.path); map['symbolicPath'] = await file.resolveSymbolicLinks(); map['size'] = stat.size; map['accessed'] = stat.accessed.toString();