expo-tiddlywiki-filesystem-android-external-storage 2.2.0 → 2.2.1
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.
|
@@ -590,6 +590,8 @@ class ExternalStorageModule : Module() {
|
|
|
590
590
|
val changes = JSONArray()
|
|
591
591
|
val indexPaths = mutableSetOf<String>()
|
|
592
592
|
|
|
593
|
+
var modifiedCount = 0
|
|
594
|
+
var deletedCount = 0
|
|
593
595
|
for (entry in indexEntries) {
|
|
594
596
|
indexPaths.add(entry.path)
|
|
595
597
|
val workFile = File(root, entry.path)
|
|
@@ -599,6 +601,7 @@ class ExternalStorageModule : Module() {
|
|
|
599
601
|
obj.put("path", entry.path)
|
|
600
602
|
obj.put("type", "delete")
|
|
601
603
|
changes.put(obj)
|
|
604
|
+
deletedCount++
|
|
602
605
|
} else {
|
|
603
606
|
// Check stat cache: size and mtime
|
|
604
607
|
val diskSize = workFile.length()
|
|
@@ -608,20 +611,30 @@ class ExternalStorageModule : Module() {
|
|
|
608
611
|
obj.put("path", entry.path)
|
|
609
612
|
obj.put("type", "modify")
|
|
610
613
|
changes.put(obj)
|
|
614
|
+
modifiedCount++
|
|
615
|
+
if (modifiedCount <= 3) {
|
|
616
|
+
android.util.Log.i("GitStatus", " modify: ${entry.path} disk(size=$diskSize,mtime=$diskMtime) vs index(size=${entry.size},mtime=${entry.mtimeSeconds})")
|
|
617
|
+
}
|
|
611
618
|
}
|
|
612
619
|
}
|
|
613
620
|
}
|
|
614
621
|
|
|
615
622
|
// 4. Files on disk but not in index → added
|
|
623
|
+
var addedCount = 0
|
|
616
624
|
for (path in workdirFiles) {
|
|
617
625
|
if (path !in indexPaths) {
|
|
618
626
|
val obj = JSONObject()
|
|
619
627
|
obj.put("path", path)
|
|
620
628
|
obj.put("type", "add")
|
|
621
629
|
changes.put(obj)
|
|
630
|
+
addedCount++
|
|
631
|
+
if (addedCount <= 5) {
|
|
632
|
+
android.util.Log.i("GitStatus", " add: $path")
|
|
633
|
+
}
|
|
622
634
|
}
|
|
623
635
|
}
|
|
624
636
|
|
|
637
|
+
android.util.Log.i("GitStatus", "Result: ${changes.length()} changes (add=$addedCount, modify=$modifiedCount, delete=$deletedCount), indexEntries=${indexEntries.size}, workdirFiles=${workdirFiles.size}")
|
|
625
638
|
changes.toString()
|
|
626
639
|
}
|
|
627
640
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "expo-tiddlywiki-filesystem-android-external-storage",
|
|
3
|
-
"version": "2.2.
|
|
3
|
+
"version": "2.2.1",
|
|
4
4
|
"description": "Expo native module for TidGi-Mobile: external storage I/O + TiddlyWiki .tid/.meta/.json batch parsing in Kotlin",
|
|
5
5
|
"main": "build/index.js",
|
|
6
6
|
"types": "build/index.d.ts",
|