1
0
mirror of https://github.com/Kovah/LinkAce.git synced 2025-01-17 21:28:30 +01:00

Allow import from absolute file paths (#690)

This commit is contained in:
Kovah 2023-11-01 14:21:05 +01:00
parent f7cf40d7cf
commit c4f401a1f7
No known key found for this signature in database
GPG Key ID: AAAA031BA9830D7B

View File

@ -12,7 +12,7 @@ class ImportCommand extends Command
use AsksForUser;
protected $signature = 'links:import
{filepath : Bookmarks file to import}
{filepath : Bookmarks file to import, use absolute paths if stored outside of LinkAce}
{--skip-meta-generation : Whether the automatic generation of titles should be skipped.}
{--skip-check : Whether the links checking should be skipped afterwards}';
@ -32,7 +32,8 @@ class ImportCommand extends Command
$this->askForUser();
$this->info('Reading file "' . $this->argument('filepath') . '"...');
$data = File::get(storage_path($this->argument('filepath')));
$filepath = $this->argument('filepath');
$data = File::get(str_starts_with($filepath, '/') ? $filepath : storage_path($filepath));
if (empty($data)) {
$this->warn('The provided file is empty or could not be read!');