|
@@ -22,6 +22,28 @@ async function main() {
|
|
|
|
|
|
await fs.ensureDir(tempDownloadDir);
|
|
|
|
|
|
+ //sqlite3
|
|
|
+ const sqliteRemoteUrl = 'https://mapbox-node-binary.s3.amazonaws.com/sqlite3/v4.0.4/node-v64-linux-x64.tar.gz';
|
|
|
+ const sqliteDecompressedFilename = `${tempDownloadDir}/node-v64-linux-x64/node_sqlite3.node`;
|
|
|
+
|
|
|
+ if (!await fs.pathExists(sqliteDecompressedFilename)) {
|
|
|
+ // Скачиваем node_sqlite3.node для винды, т.к. pkg не включает его в сборку
|
|
|
+ await pipeline(got.stream(sqliteRemoteUrl), fs.createWriteStream(`${tempDownloadDir}/sqlite.tar.gz`));
|
|
|
+ console.log(`done downloading ${sqliteRemoteUrl}`);
|
|
|
+
|
|
|
+ //распаковываем
|
|
|
+ await decompress(`${tempDownloadDir}/sqlite.tar.gz`, `${tempDownloadDir}`, {
|
|
|
+ plugins: [
|
|
|
+ decompressTargz()
|
|
|
+ ]
|
|
|
+ });
|
|
|
+ console.log('files decompressed');
|
|
|
+ }
|
|
|
+ // копируем в дистрибутив
|
|
|
+ await fs.copy(sqliteDecompressedFilename, `${outDir}/node_sqlite3.node`);
|
|
|
+ console.log(`copied ${sqliteDecompressedFilename} to ${outDir}/node_sqlite3.node`);
|
|
|
+
|
|
|
+ //ipfs
|
|
|
const ipfsDecompressedFilename = `${tempDownloadDir}/go-ipfs/ipfs`;
|
|
|
if (!await fs.pathExists(ipfsDecompressedFilename)) {
|
|
|
// Скачиваем ipfs
|