Skip to content

Commit 1143a68

Browse files
committed
add the possibility to overwrite path extension + change /build to /dist path to avoid deletion on gyp build
1 parent 894fb65 commit 1143a68

4 files changed

Lines changed: 9 additions & 9 deletions

File tree

.github/workflows/build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ jobs:
8282
- name: Download all artifacts
8383
uses: actions/download-artifact@v4
8484
with:
85-
path: build/
85+
path: dist/
8686
merge-multiple: true
8787

8888
# List all files for debugging

lib/index.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ const SQLiteOnSteroid = (db, myPeerId = null, options) => {
3939
if (!db) {
4040
throw new Error('Database instance is required');
4141
}
42-
db.loadExtension(findPreBuiltExtensionPath());
42+
db.loadExtension(options?.preBuiltExtensionPath ?? findPreBuiltExtensionPath());
4343
hlc._reset();
4444

4545
const eventEmitter = new EventEmitter();
@@ -936,10 +936,10 @@ function findPreBuiltExtensionPath () {
936936
if (process.platform === 'win32') {
937937
throw new Error('Windows is not supported for database replication');
938938
}
939-
if (fs.existsSync(path.join(__dirname, '../build/Release'))) {
940-
return path.join(__dirname, '../build/Release/keep_last'); // load extension built by npm install
939+
if (fs.existsSync(path.join(__dirname, '..', 'build', 'Release'))) {
940+
return path.join(__dirname, '..', 'build', 'Release', 'keep_last'); // load extension built by npm install
941941
}
942-
return path.join(__dirname, `../build/keep_last-${process.platform}-${process.arch}`); // load extension packed in published module
942+
return path.join(__dirname, '..', 'dist', `keep_last-${process.platform}-${process.arch}`); // load extension packed in published module
943943
}
944944

945945

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
{
22
"name": "replic-sqlite",
3-
"version": "0.2.3",
3+
"version": "0.2.4",
44
"description": "Simple, Fast, Multi-writer, Convergent, Replicated SQLite with 800 LOC only",
55
"main": "lib/index.js",
66
"directories": {
77
"lib": "lib",
88
"test": "test"
99
},
1010
"files": [
11-
"build/keep_last-*",
11+
"dist/keep_last-*",
1212
"binding.gyp",
1313
"src/*"
1414
],

0 commit comments

Comments
 (0)