Created
April 15, 2025 16:22
-
-
Save lavn0/19daac4617ba4d18e53a73d13c764b00 to your computer and use it in GitHub Desktop.
vscodeで現在日時でメモを作成する
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"version": "2.0.0", | |
"tasks": [ | |
{ | |
"label": "createMeetingNote", | |
"type": "shell", | |
"command": ".vscode/createNote.sh", | |
"args": [ | |
"_メモ", | |
"${input:name}" | |
], | |
"group": | |
{ | |
"kind": "build", | |
"isDefault": true | |
} | |
} | |
], | |
"inputs": [ | |
{ | |
"id": "name", | |
"type": "promptString", | |
"description": "名前を入力してください", | |
"default": "本日のメモ" | |
} | |
] | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# tasks.jsonと同じフォルダに置く | |
# 引数からフォルダ名と名前を取得 | |
folder_name=$1 | |
file_name=$2 | |
# フォルダが存在しない場合は作成 | |
if [ ! -d "$folder_name" ]; then | |
mkdir -p "$folder_name" | |
fi | |
# 現在日時(yyyyMMdd-HHmmss)を取得 | |
timestamp=$(date +"%Y%m%d-%H%M%S") | |
# ファイル名を作成 | |
file_name="${folder_name}/${timestamp}_${file_name}.md" | |
# 作成したファイルを開く(VSCodeで) | |
code "$file_name" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment