File tree Expand file tree Collapse file tree 2 files changed +24
-1
lines changed
Expand file tree Collapse file tree 2 files changed +24
-1
lines changed Original file line number Diff line number Diff line change 1414 "scripts" : {
1515 "build" : " tsc" ,
1616 "prepare" : " npm run build" ,
17- "lint" : " eslint '*/**/*.ts' --quiet --fix"
17+ "lint" : " eslint '*/**/*.ts' --quiet --fix" ,
18+ "install" : " node ./lib/postinstall.js"
1819 },
1920 "license" : " MIT" ,
2021 "devDependencies" : {
Original file line number Diff line number Diff line change 1+ import { existsSync , mkdirSync , appendFileSync } from 'fs' ;
2+ import { join } from 'path' ;
3+
4+ const adapterDir = 'content/adapters/storage' ;
5+
6+ ( function setupStorageAdapter ( adapterDir : string ) {
7+ try {
8+ // create storage adapter inside the storage adapter directory
9+ if ( existsSync ( join ( adapterDir , 'firebase.js' ) ) ) {
10+ console . warn ( 'A firebase.js exists in the storage adapter directory. Please setup manually!' ) ;
11+ return ;
12+ }
13+ if ( ! existsSync ( join ( __dirname , adapterDir ) ) ) {
14+ mkdirSync ( adapterDir , { recursive : true } ) ;
15+ }
16+ const content = `'use strict'\n\nmodule.exports = require('ghost-firebase-storage-adapter');\n` ;
17+ appendFileSync ( join ( adapterDir , 'firebase.js' ) , content ) ;
18+ // add configs to the dev settings
19+ } catch ( error ) {
20+ console . error ( error ) ;
21+ }
22+ } ) ( adapterDir ) ;
You can’t perform that action at this time.
0 commit comments