Thanks to visit codestin.com Credit goes to github.com
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 6153b0c commit 55503a4Copy full SHA for 55503a4
1 file changed
tools/hxcpp/Setup.hx
@@ -228,10 +228,16 @@ class Setup
228
229
public static function isRaspberryPi()
230
{
231
- var proc = new Process("uname",["-a"]);
232
- var str = proc.stdout.readLine();
233
- proc.close();
234
- return str.split(" ")[1]=="raspberrypi";
+ var modelFile = '/sys/firmware/devicetree/base/model';
+ if( !FileSystem.exists( modelFile ) )
+ return false;
+ try {
235
+ var model = sys.io.File.getContent( modelFile );
236
+ return ~/Raspberry/.match( model );
237
+ } catch(e:Dynamic) {
238
+ trace( e );
239
+ }
240
241
}
242
243
static public function startPdbServer()
0 commit comments