Skip to content

Commit

Permalink
check for local_dir's parent
Browse files Browse the repository at this point in the history
  • Loading branch information
johrstrom committed Sep 27, 2023
1 parent 022e79c commit 17ba4d8
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions apps/dashboard/config/initializers/upgrade_to_3.1.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,14 @@
old_db_dir = BatchConnect::Session.dataroot.join("db")
new_db_dir = BatchConnect::Session.db_root

# could be running this while building assets. if so, just kick out.
next if !new_db_dir.parent.exist?

# have to prep these directories here. Package should have installed
# Configuration.local_dataroot's parent directory.
local_dr = Configuration.local_dataroot

# could be running this while building assets during packaging.
# if so, just kick out.
next unless local_dr.parent.exist?

Dir.mkdir(local_dr, 0o0700) unless Dir.exist?(local_dr)
FileUtils.mkdir_p(new_db_dir) unless Dir.exist?(new_db_dir)

Expand Down

0 comments on commit 17ba4d8

Please sign in to comment.