esoftplay 0.0.112-j → 0.0.112-m
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.
- package/bin/build.js +0 -1
- package/bin/cli.js +45 -3
- package/package.json +1 -1
package/bin/build.js
CHANGED
package/bin/cli.js
CHANGED
|
@@ -558,12 +558,52 @@ function command(command) {
|
|
|
558
558
|
}
|
|
559
559
|
}
|
|
560
560
|
|
|
561
|
+
|
|
562
|
+
function devClientPre(file) {
|
|
563
|
+
if (fs.existsSync(file)) {
|
|
564
|
+
var txt = fs.readFileSync(file, 'utf8');
|
|
565
|
+
let isJSON = txt.startsWith('{') || txt.startsWith('[')
|
|
566
|
+
if (!isJSON) {
|
|
567
|
+
consoleError('app.json tidak valid')
|
|
568
|
+
return
|
|
569
|
+
}
|
|
570
|
+
let app = JSON.parse(txt)
|
|
571
|
+
app.expo.name = "DC-" + app.expo.name
|
|
572
|
+
app.expo.slug = "DC-" + app.expo.slug
|
|
573
|
+
app.expo.android.package = app.expo.android.package + "-dc"
|
|
574
|
+
app.expo.ios.bundleIdentifier = app.expo.ios.bundleIdentifier + "-dc"
|
|
575
|
+
fs.writeFileSync(file, JSON.stringify(app, undefined, 2))
|
|
576
|
+
} else {
|
|
577
|
+
consoleError(file)
|
|
578
|
+
}
|
|
579
|
+
}
|
|
580
|
+
function devClientPos(file) {
|
|
581
|
+
if (fs.existsSync(file)) {
|
|
582
|
+
var txt = fs.readFileSync(file, 'utf8');
|
|
583
|
+
let isJSON = txt.startsWith('{') || txt.startsWith('[')
|
|
584
|
+
if (!isJSON) {
|
|
585
|
+
consoleError('app.json tidak valid')
|
|
586
|
+
return
|
|
587
|
+
}
|
|
588
|
+
let app = JSON.parse(txt)
|
|
589
|
+
app.expo.name = app.expo.name.replace("DC-", "")
|
|
590
|
+
app.expo.slug = app.expo.slug.replace("DC-", "")
|
|
591
|
+
app.expo.android.package = app.expo.android.package.replace("-dc", "")
|
|
592
|
+
app.expo.ios.bundleIdentifier = app.expo.ios.bundleIdentifier.replace("-dc", "")
|
|
593
|
+
fs.writeFileSync(file, JSON.stringify(app, undefined, 2))
|
|
594
|
+
} else {
|
|
595
|
+
consoleError(file)
|
|
596
|
+
}
|
|
597
|
+
}
|
|
598
|
+
|
|
599
|
+
|
|
561
600
|
function build() {
|
|
562
601
|
const types = [
|
|
563
602
|
{
|
|
564
603
|
name: "1. IOS (Development) - Simulator",
|
|
565
604
|
cmd: "eas build --platform ios --profile development",
|
|
566
605
|
pre: () => {
|
|
606
|
+
devClientPre(appjson)
|
|
567
607
|
jsEng(appjson, false)
|
|
568
608
|
jsEng(appdebug, false)
|
|
569
609
|
jsEng(applive, false)
|
|
@@ -594,6 +634,7 @@ function build() {
|
|
|
594
634
|
name: "4. Android (Development) - apk",
|
|
595
635
|
cmd: "eas build --platform android --profile development",
|
|
596
636
|
pre: () => {
|
|
637
|
+
devClientPre(appjson)
|
|
597
638
|
jsEng(appjson, false)
|
|
598
639
|
jsEng(appdebug, false)
|
|
599
640
|
jsEng(applive, false)
|
|
@@ -638,7 +679,7 @@ function build() {
|
|
|
638
679
|
}
|
|
639
680
|
}
|
|
640
681
|
|
|
641
|
-
if (args[0] == "build") {
|
|
682
|
+
if (args[0] == "build" || args[0] == "b") {
|
|
642
683
|
let d
|
|
643
684
|
const rl = readline.createInterface({
|
|
644
685
|
input: process.stdin,
|
|
@@ -656,7 +697,8 @@ function build() {
|
|
|
656
697
|
let pre = d.pre
|
|
657
698
|
if (pre) { pre() }
|
|
658
699
|
consoleSucces("⚙⚙⚙ ... \n" + cmd)
|
|
659
|
-
command(cmd)
|
|
700
|
+
command(cmd)
|
|
701
|
+
devClientPos(appjson)
|
|
660
702
|
} else {
|
|
661
703
|
consoleError("Build type tidak ditemukan")
|
|
662
704
|
}
|
|
@@ -715,7 +757,7 @@ function doInc(file) {
|
|
|
715
757
|
consoleSucces(file + " Versi yang lama " + app.expo.version)
|
|
716
758
|
app.expo.android.versionCode = lastVersion + 1
|
|
717
759
|
app.expo.ios.buildNumber = String(lastVersion + 1)
|
|
718
|
-
app.expo.runtimeVersion = lastVersion + 1
|
|
760
|
+
app.expo.runtimeVersion = String(lastVersion + 1)
|
|
719
761
|
app.expo.version = args[1] || ('0.' + String(lastVersion + 1))
|
|
720
762
|
consoleSucces(file + " Berhasil diupdate ke versi " + app.expo.version)
|
|
721
763
|
fs.writeFileSync(file, JSON.stringify(app, undefined, 2))
|