dict


Logs | Files | README | LICENSE | GitLab


1
commit d4a7f044624176868d023f929c88744bce2bc431
2
Author: Connor Etherington <[email protected]>
3
Date:   Sun Jan 28 01:39:58 2024 +0200
4
5
    Auto-Commit Update - 20240128
6
---
7
 PKGBUILD     | 15 +++++++++------
8
 dict.install |  4 ++--
9
 usr/bin/dict |  2 ++
10
 3 files changed, 13 insertions(+), 8 deletions(-)
11
12
diff --git a/PKGBUILD b/PKGBUILD
13
index 7a9b972..e9141cb 100644
14
--- a/PKGBUILD
15
+++ b/PKGBUILD
16
@@ -28,14 +28,17 @@ package() {
17
     cd "${srcdir}/${pkgname}-${pkgver}-${pkgrel}-${arch}/usr/lib/node_modules/${pkgname}" ||
18
     cd "${srcdir}/${pkgname}/usr/lib/node_modules/${pkgname}"
19
 
20
-  install -dm0755 "${pkgdir}"/usr/lib/node_modules/${pkgname}
21
-
22
   which yarn >/dev/null 2>&1 && yarn install || npm install
23
 
24
-  cp -ar ${srcdir}/${pkgname}/usr/lib/node_modules/${pkgname}/* "${pkgdir}"/usr/lib/node_modules/${pkgname} 2>/dev/null & installed=$?;
25
-  [ $installed -eq 0 ] || cp -ar ${srcdir}/usr/lib/node_modules/${pkgname}/* "${pkgdir}"/usr/lib/node_modules/${pkgname}
26
+  cd ../../../../
27
+
28
+  install -dm0755 "${pkgdir}"/usr/lib/node_modules/${pkgname}
29
+  install -Dm0644 usr/share/licenses/${pkgname}/LICENSE "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
30
+
31
+  !which ${pkgname} >/dev/null 2>&1 && install -Dm0755 usr/bin/* -t "${pkgdir}/usr/bin/" ||
32
+    install -Dm0755 usr/bin/${pkgname} "${pkgdir}/usr/bin/${pkgname}"
33
 
34
-  install -Dm644 ${srcdir}/${pkgname}/usr/share/licenses/${pkgname}/LICENSE "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE" 2>/dev/null & installed=$?;
35
-  [ $installed -eq 0 ] || install -Dm644 ${srcdir}/usr/share/licenses/${pkgname}/LICENSE "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
36
+  cp -ar usr/lib/node_modules/${pkgname}/* "${pkgdir}"/usr/lib/node_modules/${pkgname}
37
+  install -dm0755 "${pkgdir}"/usr/lib/node_modules/${pkgname}
38
 
39
 }
40
diff --git a/dict.install b/dict.install
41
index 81de7d7..48736bb 100644
42
--- a/dict.install
43
+++ b/dict.install
44
@@ -1,12 +1,12 @@
45
 post_install(){
46
   cd /usr/lib/node_modules/dict
47
-  npm install --user ./ --global
48
+  which yarn >/dev/null 2>&1 && yarn install || npm install
49
   echo -e "\n[+] Thank you for using dict!\n"
50
 }
51
 
52
 post_upgrade(){
53
   cd /usr/lib/node_modules/dict
54
-  npm install --user ./ --global
55
+  which yarn >/dev/null 2>&1 && yarn install || npm install
56
 }
57
 
58
 pre_remove(){
59
diff --git a/usr/bin/dict b/usr/bin/dict
60
new file mode 100755
61
index 0000000..9207c2f
62
--- /dev/null
63
+++ b/usr/bin/dict
64
@@ -0,0 +1,2 @@
65
+#!/usr/bin/env node
66
+require('/usr/lib/node_modules/dict');