Skip to content

Commit

Permalink
fixup! changed justfile
Browse files Browse the repository at this point in the history
  • Loading branch information
agmes4 committed Jan 21, 2024
1 parent 5a199d4 commit 0529485
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 3 deletions.
6 changes: 3 additions & 3 deletions justfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ dev-psql := drc + " exec --user=postgres dev-db psql pycroft"
schemadir := justfile_directory() / "data"
sql_schema := schemadir / "pycroft_schema.sql"
sql_dump := schemadir / "pycroft.sql"
sswd := justfile_directory() / "docker" / "db" / "docker-entrypoint-initdb.d" / "swdd.sql"
swdd := justfile_directory() / "docker" / "db" / "docker-entrypoint-initdb.d" / "swdd.sql"

# test

Expand Down Expand Up @@ -54,8 +54,8 @@ _schema-import: _ensure_schema_dir _stop_all (_up "dev-db")
-c 'drop schema if exists pycroft cascade' \
-c '\echo importing schema…' \
-f {{ sql_schema }} \
-c '\echo import sswd' \
-f {{ sswd }} \
-c '\echo import swdd' \
-f {{ swdd }} \
-c '\echo importing dump…' \
-f {{ sql_dump }} \
-c '\echo all done.'
Expand Down
24 changes: 24 additions & 0 deletions web/resources/js/user-suite.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
/*
* Copyright (c) 2024. The Pycroft Authors. See the AUTHORS file.
* This file is part of the Pycroft project and licensed under the terms of
* the Apache License, Version 2.0. See the LICENSE file for details
*/

function waitForKeyPress(callback: (event: KeyboardEvent) => void): void {
const handleKeyPress = (event: KeyboardEvent) => {
// Call the callback function with the event when a key is pressed
callback(event);

// Remove the event listener after the first key press (if you want it to happen only once)
document.removeEventListener('keydown', handleKeyPress);
};

// Add the event listener to the document
document.addEventListener('keydown', handleKeyPress);
}

// Example of using the function
waitForKeyPress((event) => {
console.log(`Key pressed: ${event.key}`);
// Add your logic here based on the key press
});

0 comments on commit 0529485

Please sign in to comment.