Skip to content

Commit

Permalink
Code formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
cedx committed Oct 27, 2024
1 parent ad833e9 commit d42fe71
Showing 1 changed file with 7 additions and 15 deletions.
22 changes: 7 additions & 15 deletions src/which/Process.hx
Original file line number Diff line number Diff line change
@@ -1,35 +1,27 @@
package which;

import asys.io.Process as AsyncProcess;
import haxe.Int64;
using StringTools;
using tink.io.Source;

#if java
import haxe.Int64;
import java.security.auth.module.UnixSystem;
#elseif nodejs
import js.Node;
#elseif php
import php.Syntax;
#end

/** Provides information about the current process. **/
abstract class Process {

/** The identifier of the current process's group. **/
public static var gid(get, never): Promise<Int>;
static inline function get_gid() return Finder.isWindows ? new Error(MethodNotAllowed, "Not supported on Windows platform.") :
#if java Promise.resolve(Int64.toInt(new UnixSystem().getGid()))
#elseif js Promise.resolve(Node.process.getgid())
#elseif php Promise.resolve(Syntax.code("posix_getgid()"))
#if java Promise.resolve(Int64.toInt(new java.security.auth.module.UnixSystem().getGid()))
#elseif js Promise.resolve(js.Node.process.getgid())
#elseif php Promise.resolve(php.Syntax.code("posix_getgid()"))
#else getProcessId("g") #end;

/** The identifier of the current process's user. **/
public static var uid(get, never): Promise<Int>;
static inline function get_uid() return Finder.isWindows ? new Error(MethodNotAllowed, "Not supported on Windows platform.") :
#if java Promise.resolve(Int64.toInt(new UnixSystem().getUid()))
#elseif js Promise.resolve(Node.process.getuid())
#elseif php Promise.resolve(Syntax.code("posix_getuid()"))
#if java Promise.resolve(Int64.toInt(new java.security.auth.module.UnixSystem().getUid()))
#elseif js Promise.resolve(js.Node.process.getuid())
#elseif php Promise.resolve(php.Syntax.code("posix_getuid()"))
#else getProcessId("u") #end;

/** Gets the numeric identity of the current process by using the "id" command. **/
Expand Down

0 comments on commit d42fe71

Please sign in to comment.