Skip to content

Commit

Permalink
Merge pull request #5 from ribizli/std_0.135.0
Browse files Browse the repository at this point in the history
deps upgrade
  • Loading branch information
ribizli authored Apr 16, 2022
2 parents 5e039b4 + bbb8267 commit 80bacaf
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 10 deletions.
5 changes: 1 addition & 4 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
{
"deno.enable": true,
"deno.lint": true,
"deno.unstable": true,
"deno.import_intellisense_origins": {
"https://deno.land": true
}
"deno.unstable": true
}
3 changes: 2 additions & 1 deletion deps.ts
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
export { concat, equals } from 'https://deno.land/[email protected]/bytes/mod.ts';
export { concat, equals } from 'https://deno.land/[email protected]/bytes/mod.ts';
export { iterateReader } from 'https://deno.land/[email protected]/streams/conversion.ts';
5 changes: 2 additions & 3 deletions rcon.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { concat, equals } from './deps.ts';
import { iterateReader } from 'https://deno.land/[email protected]/streams/conversion.ts';
import { concat, equals, iterateReader } from './deps.ts';

const FrameBuffer = new Uint8Array([0, 1, 0, 0]);

Expand Down Expand Up @@ -74,7 +73,7 @@ export class Rcon {
port: this.port,
});

void this.read();
this.read().catch(() => {});

await this.sendData(
new Uint8Array([0, 0, 0, 0]),
Expand Down
4 changes: 2 additions & 2 deletions terminal.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// https://www.lihaoyi.com/post/BuildyourownCommandLinewithANSIescapecodes.html

import { equals } from './deps.ts';
import { equals, iterateReader } from './deps.ts';

const ENTER = new Uint8Array([13]);
const CTRL_C = new Uint8Array([3]);
Expand Down Expand Up @@ -30,7 +30,7 @@ export async function* terminal(prompt = "> ") {
await Deno.stdout.write(encoder.encode(prompt));

while (true) {
for await (const chunk of Deno.iter(Deno.stdin)) {
for await (const chunk of iterateReader(Deno.stdin)) {
const key = {
enter: equals(chunk, ENTER),
up: equals(chunk, ARROW_UP),
Expand Down

0 comments on commit 80bacaf

Please sign in to comment.