Skip to content

Commit

Permalink
actually installable, BUT resources not working
Browse files Browse the repository at this point in the history
  • Loading branch information
masukomi committed Sep 11, 2022
1 parent 361ff2e commit bc441b4
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 13 deletions.
16 changes: 13 additions & 3 deletions META6.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,25 @@
"build-depends": [
],
"depends": [
"Definitely",
"Terminal::ANSIColor",
"Terminal::Width",
"Text::MiscUtils",
"DB::SQLite",
"TOML",
"Color"
],
"description": "blah blah blah",
"license": "Artistic-2.0",
"description": "Clu (Command LookUp) helps you document your utility scripts",
"license": "MIT",
"name": "Clu",
"perl": "6.d",
"provides": {
"Clu": "lib/Clu.rakumod"
"Clu::Command": "lib/Clu/Command.rakumod",
"Clu::Ingester": "lib/Clu/Ingester.rakumod",
"Clu::TerminalUtilities": "lib/Clu/TerminalUtilities.rakumod"
},
"resources": [
"empty_database.db"
],
"source-url": "",
"tags": [
Expand Down
17 changes: 7 additions & 10 deletions clu
Original file line number Diff line number Diff line change
Expand Up @@ -112,23 +112,20 @@ sub ingest(Str $path) {


sub guarantee-db() returns Bool {
say "empty_database.db in resources? " ~ %?RESOURCES<empty_database.db>.raku;
my $dir = "$*HOME/.config/clu";
my $path = "$dir/database.db";
return True if $path.IO.e;
mkdir($dir);

# TODO:
# - create a resources directory
# - put the default db in it
# - copy the db from there to $path
# - package this up
#
die "UNFINISHED. SEE https://github.com/masukomi/Clu for manual install instructions.";
unless $dir.IO.e {
mkdir($dir);
}

unless $path.IO.e {
my $proc = run 'cp', %?RESOURCES<empty_database.db>, $path
}

CATCH {
when X::IO::Mkdir { die "Unable to create directory: $dir"; }

}

}

0 comments on commit bc441b4

Please sign in to comment.