esoftplay 0.0.126-u → 0.0.126-w

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.
Files changed (2) hide show
  1. package/bin/cli.js +20 -3
  2. package/package.json +1 -1
package/bin/cli.js CHANGED
@@ -506,6 +506,7 @@ function readToJSON(path) {
506
506
  return isJSON ? JSON.parse(txt) : txt
507
507
  }
508
508
 
509
+
509
510
  function publish(notes) {
510
511
  jsEng(appjson, true)
511
512
  jsEng(appdebug, true)
@@ -595,8 +596,24 @@ function publish(notes) {
595
596
  esplibs.forEach((key) => {
596
597
  stringBuilder += ("\n" + key + ": " + pack.dependencies[key])
597
598
  })
598
- stringBuilder += (notes != '' ? ("\n\n- " + notes) : '')
599
- tm(stringBuilder)
599
+ const { exec } = require('child_process');
600
+ exec("publisher=$(npx expo whoami &); echo $publisher;", (error, stdout, stderr) => {
601
+ if (error) {
602
+ console.error(`exec error: ${error}`);
603
+ return;
604
+ }
605
+ let accountName = stdout.trim();
606
+ stringBuilder += "\npublisher: @" + accountName + "\n"
607
+ stringBuilder += (notes != '' ? ("\n\n- " + notes) : '')
608
+ if (notes.startsWith('*') && ajson.config.publish_id) {
609
+ const config = readToJSON(confjson);
610
+ const ajson = readToJSON(appjson);
611
+ const url = config.protocol + "://" + config.api + "." + config.domain + config.uri + config.publish_uri + ajson.config.publish_id
612
+ fetch(url).then((res) => res.json()).then(consoleSucces)
613
+ }
614
+ tm(stringBuilder)
615
+ });
616
+
600
617
  }
601
618
  }
602
619
 
@@ -972,7 +989,7 @@ function switchStatus(status) {
972
989
  valid = copyFromTo(status.includes("l") ? applive : appdebug, appjson)
973
990
  if (valid) {
974
991
  valid = copyFromTo(status.includes("l") ? conflive : confdebug, confjson)
975
-
992
+
976
993
  const cjson = readToJSON(confjson)
977
994
  if (cjson.hasOwnProperty('config')) {
978
995
  if (cjson.config.hasOwnProperty('build')) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "esoftplay",
3
- "version": "0.0.126-u",
3
+ "version": "0.0.126-w",
4
4
  "description": "embedding data from esoftplay framework (web based) into mobile app",
5
5
  "main": "cache/index.js",
6
6
  "types": "../../index.d.ts",