dict


Logs | Files | README | LICENSE | GitLab


1
commit 59cc4fbf4db4e7eb982aa8d2a7dadeb4eb5e6046
2
Author: Connor Etherington <[email protected]>
3
Date:   Sun Jan 28 00:10:18 2024 +0200
4
5
    Auto-Commit Update 28.01.2024 - 00:10:18
6
---
7
 PKGBUILD     |  9 ++++++---
8
 dict.install | 15 +++++++++++++++
9
 2 files changed, 21 insertions(+), 3 deletions(-)
10
11
diff --git a/PKGBUILD b/PKGBUILD
12
index b345625..049e60f 100644
13
--- a/PKGBUILD
14
+++ b/PKGBUILD
15
@@ -7,7 +7,8 @@ pkgdesc="An easy to use english dictionary for the command line."
16
 arch=(any)
17
 url="https://gitlab.com/a4to/${pkgname}"
18
 license=('MIT')
19
-depends=('nodejs', 'npm')
20
+install="${pkgname}.install"
21
+depends=('nodejs' 'npm')
22
 source=("git+$url.git")
23
 sha256sums=('SKIP')
24
 
25
@@ -18,8 +19,10 @@ package() {
26
     cd "${srcdir}/${pkgname}/usr/lib/node_modules/${pkgname}"
27
 
28
   which yarn >/dev/null 2>&1 && yarn install || npm install
29
-  cp -ar usr/lib/node_modules/${pkgname}/* "${pkgdir}"/usr/lib/node_modules/${pkgname}
30
+  cp -ar ${srcdir}/${pkgname}/usr/lib/node_modules/${pkgname}/* "${pkgdir}"/usr/lib/node_modules/${pkgname} 2>/dev/null & installed=$?;
31
+  [ $installed -eq 0 ] || cp -ar ${srcdir}/usr/lib/node_modules/${pkgname}/* "${pkgdir}"/usr/lib/node_modules/${pkgname}
32
 
33
-  install -Dm644 usr/share/licenses/${pkgname}/LICENSE "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
34
+  install -Dm644 ${srcdir}/${pkgname}/usr/share/licenses/${pkgname}/LICENSE "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE" 2>/dev/null ||
35
+    install -Dm644 ${srcdir}/usr/share/licenses/${pkgname}/LICENSE "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
36
 
37
 }
38
diff --git a/dict.install b/dict.install
39
new file mode 100644
40
index 0000000..48736bb
41
--- /dev/null
42
+++ b/dict.install
43
@@ -0,0 +1,15 @@
44
+post_install(){
45
+  cd /usr/lib/node_modules/dict
46
+  which yarn >/dev/null 2>&1 && yarn install || npm install
47
+  echo -e "\n[+] Thank you for using dict!\n"
48
+}
49
+
50
+post_upgrade(){
51
+  cd /usr/lib/node_modules/dict
52
+  which yarn >/dev/null 2>&1 && yarn install || npm install
53
+}
54
+
55
+pre_remove(){
56
+  rm -rf /usr/lib/node_modules/dict
57
+}
58
+