From 98335a2a511fbbe74fa4ff94632c4c42a53a5fcb Mon Sep 17 00:00:00 2001 From: lxsang Date: Mon, 6 Dec 2021 12:23:05 +0100 Subject: [PATCH] linux-worker: automatically set job pwd if it is not specified in job description --- libantosdk/README.md | 1 + libantosdk/build/debug/README.md | 1 + libantosdk/build/debug/core/linux.worker.js | 4 ++++ libantosdk/build/debug/package.json | 2 +- libantosdk/build/release/libantosdk.zip | Bin 1274859 -> 1274931 bytes libantosdk/core/linux.worker.js | 4 ++++ libantosdk/package.json | 2 +- packages.json | 2 +- 8 files changed, 13 insertions(+), 3 deletions(-) diff --git a/libantosdk/README.md b/libantosdk/README.md index 43f92c0..04457c7 100644 --- a/libantosdk/README.md +++ b/libantosdk/README.md @@ -2,6 +2,7 @@ AntOSDK: development API for AntOS based applications/projects ## Change logs +- 0.0.13: allow linux-job handle to set defaut pwd if it is not specified in job description - 0.0.12: TS worker now allows user specific compile options (defined un build file) - 0.0.11: Update AntOS API v1.2.1 - 0.0.10: fix binary readfile bug diff --git a/libantosdk/build/debug/README.md b/libantosdk/build/debug/README.md index 43f92c0..04457c7 100644 --- a/libantosdk/build/debug/README.md +++ b/libantosdk/build/debug/README.md @@ -2,6 +2,7 @@ AntOSDK: development API for AntOS based applications/projects ## Change logs +- 0.0.13: allow linux-job handle to set defaut pwd if it is not specified in job description - 0.0.12: TS worker now allows user specific compile options (defined un build file) - 0.0.11: Update AntOS API v1.2.1 - 0.0.10: fix binary readfile bug diff --git a/libantosdk/build/debug/core/linux.worker.js b/libantosdk/build/debug/core/linux.worker.js index 4e2c20c..41a0396 100644 --- a/libantosdk/build/debug/core/linux.worker.js +++ b/libantosdk/build/debug/core/linux.worker.js @@ -37,6 +37,10 @@ class LinuxJob extends AntOSDKBaseJob { this.result("Done"); }; socket.onopen = (e) => { + if(!this.job.data.pwd) + { + this.job.data.pwd = this.job.root; + } // send the command const cmd = { path: path, diff --git a/libantosdk/build/debug/package.json b/libantosdk/build/debug/package.json index d4123e5..4453376 100644 --- a/libantosdk/build/debug/package.json +++ b/libantosdk/build/debug/package.json @@ -7,7 +7,7 @@ "author": "Xuan Sang LE", "email": "mrsang@iohub.dev" }, - "version": "0.0.12-a", + "version": "0.0.13-a", "category": "Development", "iconclass": "fa fa-cog", "mimes": [ diff --git a/libantosdk/build/release/libantosdk.zip b/libantosdk/build/release/libantosdk.zip index aba6a6de2fef1e6821518bcd2cda6c62ccf7e6bd..664ea9bee5be41460954aef1680fa552613a2c1c 100644 GIT binary patch delta 2692 zcmZV=2{=@1`;0MmLo-N32*qfqgcfVYGMcWf6uJF08Z^c*M5QKIk_Oq2Jwif~$k-Bv z%2t-N;3r*K1`(=@_|FVKa^Lg3&w0=Hz03E0?{-*2gyLa>u%!i@TL1t6J|M^bdNBMvyg9ZEV#zbdf6z2N~?Tp_0f;l3A0n8)H zsfBRr>GmqSuzgB7k!D3krHx`=Upbi~oA-A=-9ofuK6DROGZWz=C-tQw5>GK21nOge zV;@C2x$R1nbCZ(ZKPz|`WKPXZnZt}#EOb??jHA=+i7z8DW%SC4Swq8p0wajWS`oVF z(E`V8L_tjYhnco>?RN`Z(po!W^i6eAk}|XLBY(Um2uL#;#fMPgQvsot16B|60t;}2 zv6rE?*jWS6?q7)*q%gSb9ldCyx4y zOO{ee@ej8aL(_u=(>$yEwuvkCsHokObnNiR3Lu^`=gK!YV3op(kBOYrf0XJV$*>l9 z(5^Y|ew!<5uG-~%*dMIHO{ftWfoA|laKbbBP!@AyM`mm`7o$SqV5zE+!Y{H`(EN+R zZ)eM|j(rO7lCee3cKss8qD-0z!#MqnoXR&8zq$Cj=4=_o&Iv2k*GpuRw!6s%K`q*A z@wx}at6U%*Mu!NS2qU!x3Jd_QasdE86i#cLp)mo6^&mQ0HBq`XM62d8Jd@eFbwwQ{ zA3^&Ps=el}o&Z4Uftd0P*3kO+w;ztGB~CLt#}Dc3weWu@)fzq4F>rmlcY<|`Cm#8? z(pczT$`#Kxi@E^gbEuOEqE)OT=bw%2F}{$6&7s#jm)C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TNEk|89$xT_od7CP0g0#%oEf z{8vZ+m_Xl_Yhy$$eSpLi7cDyRR#?$uQja0pV)yV-bv=BsJE=dXmNwB%OlXndYgp%N zi0WaZ75omsCiN(ya8c(~j|xX&06?fLa6oH`l=YIBM80sv<__Z#$k%a)6>N`Ve?3XU zoel?dU5A7Cc$3J^ycNSXZ)9islV<{uYwapMppJiZ}qEhehmJ z^?T^u&qk%R5q4)K0D$nzL-aR+UBf}5`hu|~g+y9lbQ%wLhl83Tt6aC5hG~T1SHxst zC^`s(Oi)YM1n>bSs4T`=3ZG?y>e|BK#K2Up5*7gNng9U8a-N`6f0BkZm>@yq-6Zt3 z(}DY$pqhrzI~45!o=-&ql%p6xVV*Al)ENM9R|Kf~qYL4GA)aVFpYBw#xhs4favDm-GHgA}}_6|-cqiz5c< R1OQl!eC9|GWif=Ve*>&fy>|cr diff --git a/libantosdk/core/linux.worker.js b/libantosdk/core/linux.worker.js index 4e2c20c..41a0396 100644 --- a/libantosdk/core/linux.worker.js +++ b/libantosdk/core/linux.worker.js @@ -37,6 +37,10 @@ class LinuxJob extends AntOSDKBaseJob { this.result("Done"); }; socket.onopen = (e) => { + if(!this.job.data.pwd) + { + this.job.data.pwd = this.job.root; + } // send the command const cmd = { path: path, diff --git a/libantosdk/package.json b/libantosdk/package.json index d4123e5..4453376 100644 --- a/libantosdk/package.json +++ b/libantosdk/package.json @@ -7,7 +7,7 @@ "author": "Xuan Sang LE", "email": "mrsang@iohub.dev" }, - "version": "0.0.12-a", + "version": "0.0.13-a", "category": "Development", "iconclass": "fa fa-cog", "mimes": [ diff --git a/packages.json b/packages.json index 48b7675..703516f 100644 --- a/packages.json +++ b/packages.json @@ -205,7 +205,7 @@ "description": "https://raw.githubusercontent.com/lxsang/antosdk-apps/master/libantosdk/README.md", "category": "Development", "author": "Xuan Sang LE", - "version": "0.0.12-a", + "version": "0.0.13-a", "dependencies": [], "download": "https://raw.githubusercontent.com/lxsang/antosdk-apps/master/libantosdk/build/release/libantosdk.zip" },