File tree Expand file tree Collapse file tree 3 files changed +25
-6
lines changed
resources/assets/opencomputers/loot/openos/bin
scala/li/cil/oc/server/component Expand file tree Collapse file tree 3 files changed +25
-6
lines changed Original file line number Diff line number Diff line change 11## Fixes/improvements
22
3+ * [ #3682 ] Add error handling to the ` flash ` OpenOS program
34* [ #3764 ] Fix left and right names being swapped in the Rack GUI
45* [ #3779 ] Fix ` os.sleep(0) ` causing ` too long without yielding ` (Ocawesome101)
56* (1.12) [ #3774 ] Fix Jukebox driver (kebufu)
Original file line number Diff line number Diff line change 1515local function printRom ()
1616 local eeprom = component .eeprom
1717 io.write (eeprom .get ())
18+
19+ return nil
1820end
1921
2022local function readRom ()
@@ -37,6 +39,8 @@ local function readRom()
3739 if not options .q then
3840 io.write (" All done!\n The label is '" .. eeprom .getLabel () .. " '.\n " )
3941 end
42+
43+ return nil
4044end
4145
4246local function writeRom ()
@@ -60,15 +64,22 @@ local function writeRom()
6064 io.write (" Please do NOT power down or restart your computer during this operation!\n " )
6165 end
6266
63- eeprom .set (bios )
67+ local result , reason = eeprom .set (bios )
68+ if reason then
69+ return nil , reason
70+ end
6471
6572 local label = args [2 ]
6673 if not options .q and not label then
6774 io.write (" Enter new label for this EEPROM. Leave input blank to leave the label unchanged.\n " )
6875 label = io.read ()
6976 end
7077 if label and # label > 0 then
71- eeprom .setLabel (label )
78+ local result , reason = eeprom .setLabel (label )
79+ if reason then
80+ return nil , reason
81+ end
82+
7283 if not options .q then
7384 io.write (" Set label to '" .. eeprom .getLabel () .. " '.\n " )
7485 end
@@ -77,12 +88,19 @@ local function writeRom()
7788 if not options .q then
7889 io.write (" All done! You can remove the EEPROM and re-insert the previous one now.\n " )
7990 end
91+
92+ return nil
8093end
8194
95+ local result , reason
8296if options .l then
83- printRom ()
97+ result , reason = printRom ()
8498elseif options .r then
85- readRom ()
99+ result , reason = readRom ()
86100else
87- writeRom ()
101+ result , reason = writeRom ()
88102end
103+ if reason then
104+ io.stderr :write (reason .. ' \n ' )
105+ return 1
106+ end
Original file line number Diff line number Diff line change @@ -76,7 +76,7 @@ class EEPROM extends prefab.ManagedEnvironment with DeviceInfo {
7676 return result(Unit , " storage is readonly" )
7777 }
7878 label = args.optString(0 , " EEPROM" ).trim.take(24 )
79- if (label.length == 0 ) label = " EEPROM"
79+ if (label.isEmpty ) label = " EEPROM"
8080 result(label)
8181 }
8282
You can’t perform that action at this time.
0 commit comments