...
 
Commits (2)
......@@ -4,7 +4,7 @@ linux:
- cd src
- make
- mkdir CleanSerial
- mv -v "Clean System Files" {TTY,iTasksTTY}.[id]cl POSIX/Platform.[id]cl CleanSerial
- mv -v "Clean System Files" {TTY,iTasksTTY}.[id]cl POSIX/TTYPlatform.[id]cl CleanSerial
- tar czf ../CleanSerial-linux-x64.tar.gz CleanSerial
artifacts:
paths:
......@@ -17,7 +17,7 @@ windows-x86:
- cd src
- make DETECTED_OS=Windows CC=x86_64-w64-mingw32-gcc-win32 CFLAGS=-m32
- mkdir CleanSerial
- mv -v "Clean System Files" {TTY,iTasksTTY}.[id]cl Windows/Platform.[id]cl CleanSerial
- mv -v "Clean System Files" {TTY,iTasksTTY}.[id]cl Windows/TTYPlatform.[id]cl CleanSerial
- zip -rv ../CleanSerial-windows-x86.zip CleanSerial
artifacts:
paths:
......@@ -30,7 +30,7 @@ windows-x64:
- cd src
- make DETECTED_OS=Windows CC=x86_64-w64-mingw32-gcc CFLAGS=-m64
- mkdir CleanSerial
- mv -v "Clean System Files" {TTY,iTasksTTY}.[id]cl Windows/Platform.[id]cl CleanSerial
- mv -v "Clean System Files" {TTY,iTasksTTY}.[id]cl Windows/TTYPlatform.[id]cl CleanSerial
- zip -rv ../CleanSerial-windows-x64.zip CleanSerial
artifacts:
paths:
......
definition module Platform
definition module TTYPlatform
getDevices :: !*World -> *([String], !*World)
implementation module Platform
implementation module TTYPlatform
import Data.Error
import StdMisc, StdOverloaded, StdString
import StdEnv
import System.Directory
import Data.Func
import Text
getDevices :: !*World -> *([String], !*World)
getDevices w = case readDirectory "/dev" w of
(Error (errcode, errmsg), w) = abort errmsg
(Ok entries, w) = (entries, w)
(Ok entries, w) = (sortBy (on (>) known) (filter isaTTYdevice entries), w)
isaTTYdevice "." = False
isaTTYdevice ".." = False
isaTTYdevice t = startsWith "tty" t
known t
| startsWith "ttyACM" t = 1
| startsWith "ttyUSB" t = 1
| startsWith "ttyS" t = 1
= 0
......@@ -5,7 +5,7 @@ import StdEnv
import System.OS
import Text
import Platform
import TTYPlatform
import code from "ctty.o"
......
definition module Platform
definition module TTYPlatform
getDevices :: !*World -> *([String], !*World)
implementation module Platform
implementation module TTYPlatform
import code from library "CleanSerial_library"
import code from library "CleanSerial2_library"
......
......@@ -15,6 +15,5 @@ all: listDevices
cpm project $(basename $@) create
cpm project $@ target iTasks
cpm project $@ set -h 2000m -s 20m -dynamics
cpm project $@ root ..
cpm project $@ path add "$$PWD/../$(DETECTED_OS)"
cpm project $@ path add "$$PWD/.."