summaryrefslogtreecommitdiff
path: root/js/chmod.ts
diff options
context:
space:
mode:
authorKitson Kelly <me@kitsonkelly.com>2019-03-10 04:30:38 +1100
committerRyan Dahl <ry@tinyclouds.org>2019-03-09 12:30:38 -0500
commit034e2cc02829c9244b32232074c7a48af827a2fb (patch)
treebade01606a1ee076c1f753ce99c97ddb1e4edf30 /js/chmod.ts
parent8c7a12d1b258f0ef5ab27f49c424331d43e8d97f (diff)
Migrate from tslint to eslint for linting (#1905)
Diffstat (limited to 'js/chmod.ts')
-rw-r--r--js/chmod.ts26
1 files changed, 13 insertions, 13 deletions
diff --git a/js/chmod.ts b/js/chmod.ts
index 2a9b1b01d..3b14ef5bc 100644
--- a/js/chmod.ts
+++ b/js/chmod.ts
@@ -3,6 +3,19 @@ import * as msg from "gen/msg_generated";
import * as flatbuffers from "./flatbuffers";
import * as dispatch from "./dispatch";
+function req(
+ path: string,
+ mode: number
+): [flatbuffers.Builder, msg.Any, flatbuffers.Offset] {
+ const builder = flatbuffers.createBuilder();
+ const path_ = builder.createString(path);
+ msg.Chmod.startChmod(builder);
+ msg.Chmod.addPath(builder, path_);
+ msg.Chmod.addMode(builder, mode);
+ const inner = msg.Chmod.endChmod(builder);
+ return [builder, msg.Any.Chmod, inner];
+}
+
/** Changes the permission of a specific file/directory of specified path
* synchronously.
*
@@ -19,16 +32,3 @@ export function chmodSync(path: string, mode: number): void {
export async function chmod(path: string, mode: number): Promise<void> {
await dispatch.sendAsync(...req(path, mode));
}
-
-function req(
- path: string,
- mode: number
-): [flatbuffers.Builder, msg.Any, flatbuffers.Offset] {
- const builder = flatbuffers.createBuilder();
- const path_ = builder.createString(path);
- msg.Chmod.startChmod(builder);
- msg.Chmod.addPath(builder, path_);
- msg.Chmod.addMode(builder, mode);
- const inner = msg.Chmod.endChmod(builder);
- return [builder, msg.Any.Chmod, inner];
-}