Skip to content

Commit

Permalink
fix a bug that prevented database creation for new installs
Browse files Browse the repository at this point in the history
  • Loading branch information
chad1008 committed Mar 24, 2021
1 parent 2954014 commit 3122f85
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,12 @@ function is_tag() {
*/
function is_legacy_db() {
$file = $_SERVER['alfred_workflow_data'] . '/gifomattic.db';

// Check if a database exists. If not, set up a workflow folder to put the database in.
if ( ! file_exists( $file ) ) {
mkdir( $_SERVER['alfred_workflow_data'] );
}

$db = new sqlite3( $file );
$query = 'PRAGMA table_info( gifs )';
$result = $db->query( $query );
Expand Down

0 comments on commit 3122f85

Please sign in to comment.