MCPcopy
hub / github.com/yume-chan/ya-webadb / rm

Method rm

libraries/adb/src/adb.ts:134–158  ·  view source on GitHub ↗
(
        filenames: string | readonly string[],
        options?: { recursive?: boolean; force?: boolean },
    )

Source from the content-addressed store, hash-verified

132 }
133
134 rm(
135 filenames: string | readonly string[],
136 options?: { recursive?: boolean; force?: boolean },
137 ): Promise<string> {
138 const args = ["rm"];
139 if (options?.recursive) {
140 args.push("-r");
141 }
142 if (options?.force) {
143 args.push("-f");
144 }
145 if (Array.isArray(filenames)) {
146 for (const filename of filenames) {
147 // https://github.com/microsoft/typescript/issues/17002
148 args.push(escapeArg(filename as string));
149 }
150 } else {
151 // https://github.com/microsoft/typescript/issues/17002
152 args.push(escapeArg(filenames as string));
153 }
154 // https://android.googlesource.com/platform/packages/modules/adb/+/1a0fb8846d4e6b671c8aa7f137a8c21d7b248716/client/adb_install.cpp#984
155 args.push("</dev/null");
156
157 return this.subprocess.noneProtocol.spawnWaitText(args);
158 }
159
160 async sync(): Promise<AdbSync> {
161 const socket = await this.createSocket("sync:");

Callers 2

pushAndInstallStreamMethod · 0.80
cleanupMethod · 0.80

Calls 3

escapeArgFunction · 0.85
pushMethod · 0.80
spawnWaitTextMethod · 0.45

Tested by

no test coverage detected