brasil-ceps-offline 1.0.1 → 1.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -9,8 +9,10 @@ const path_1 = __importDefault(require("path"));
|
|
|
9
9
|
const zlib_1 = __importDefault(require("zlib"));
|
|
10
10
|
// Substitua pelo link direto que você copiou do seu GitHub Releases
|
|
11
11
|
const URL_DO_BANCO = 'https://github.com/kaique-oliveira/lib-address-br/releases/download/v1.0.0/brasil-ceps.sqlite.gz';
|
|
12
|
-
|
|
13
|
-
const
|
|
12
|
+
// Subimos DOIS níveis (de dist/scripts -> dist -> raiz) para criar a pasta no lugar certo
|
|
13
|
+
const DB_DIR = path_1.default.join(__dirname, '..', '..', '.db');
|
|
14
|
+
// Ajustamos o nome para casar exatamente com o que a lib está procurando
|
|
15
|
+
const DB_PATH = path_1.default.join(DB_DIR, 'ceps.sqlite');
|
|
14
16
|
function downloadDatabase() {
|
|
15
17
|
if (!fs_1.default.existsSync(DB_DIR)) {
|
|
16
18
|
fs_1.default.mkdirSync(DB_DIR, { recursive: true });
|
package/package.json
CHANGED