-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #420 from openstad/codeimprovements/better-setup-a…
…nd-seeds Codeimprovements/better setup and seeds
- Loading branch information
Showing
12 changed files
with
119 additions
and
115 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
require('dotenv').config(); | ||
const fs = require('fs').promises; | ||
|
||
(async () => { | ||
|
||
try { | ||
|
||
console.log('Init default images...'); | ||
|
||
try { | ||
|
||
let files = await fs.readdir(`seeds/lorem-images`); | ||
let targetDir = `${process.env.PWD}${process.env.IMAGES_DIR || '/images'}`; | ||
for (let file of files) { | ||
console.log(` ${file}`); | ||
await fs.copyFile( `seeds/lorem-images/${file}`, `${targetDir}/${file}` ); | ||
} | ||
|
||
} catch(err) { | ||
console.log(err); | ||
} | ||
|
||
} catch (err) { | ||
console.log(err); | ||
} finally { | ||
process.exit(); | ||
} | ||
|
||
})(); |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1 @@ | ||
#!/bin/bash | ||
if [ ! -f "./init/done" ]; then | ||
npm run init-database && touch ./init/done; | ||
fi |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters