{"id":25198039,"url":"https://github.com/danedens/node_injectors","last_synced_at":"2025-04-04T17:17:26.529Z","repository":{"id":164492130,"uuid":"639958653","full_name":"DanEdens/Node_injectors","owner":"DanEdens","description":"Windows scripts for creating quick Node-red import blocks","archived":false,"fork":false,"pushed_at":"2023-05-12T16:15:23.000Z","size":80,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-10T02:41:23.327Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Batchfile","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/DanEdens.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-05-12T16:10:18.000Z","updated_at":"2023-05-12T16:10:37.000Z","dependencies_parsed_at":null,"dependency_job_id":"e124829a-2f31-46bb-84e5-a29165fd84cc","html_url":"https://github.com/DanEdens/Node_injectors","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DanEdens%2FNode_injectors","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DanEdens%2FNode_injectors/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DanEdens%2FNode_injectors/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DanEdens%2FNode_injectors/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/DanEdens","download_url":"https://codeload.github.com/DanEdens/Node_injectors/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247217220,"owners_count":20903009,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-02-10T02:40:37.586Z","updated_at":"2025-04-04T17:17:26.523Z","avatar_url":"https://github.com/DanEdens.png","language":"Batchfile","funding_links":[],"categories":[],"sub_categories":[],"readme":"Here is my new version, I just want to add to the start, a check for if $1 is == to \"task\" then to goto :payload after shifting \"task\" out of the command, or to otherwise go to :payloadvar. \n\n\n```\n@echo off\nrem Get the first argument from the command line.set arg=%*\nrem Create a temporary file.echo \"\" \u003e C:\\Users\\danedens\\bin\\tempfile\nrem Replace \"recognize\" with the first argument in the payload and output to the temp file.sed -e \"s/TEMP/%arg%/g\" C:\\Users\\danedens\\bin\\payloadvar.txt \u003e C:\\Users\\danedens\\bin\\tempfile\nrem Copy the contents of the temporary file to the clipboard.cat C:\\Users\\danedens\\bin\\tempfile | clip\nrem Delete the temporary file.del C:\\Users\\danedens\\bin\\tempfile\nrem Exit the batch script.exit /b\n```\nBard \u003e \nSure, here is the updated batch script that you can use:\n\n```\n@echo off\n\nrem Get the first argument from the command line.\nset arg=%*\n\nrem Check if the first argument is equal to \"task\".\nif \"%1\" == \"task\" (\n  rem Shift the first argument off the command line.\n  shift\n\n  rem Go to the \"payload\" label.\n  goto :payload\n) else (\n  rem Go to the \"payloadvar\" label.\n  goto :payloadvar\n)\n\n:payload\nrem Replace \"recognize\" with the first argument in the payload and output to the temp file.\nsed -e \"s/TEMP/%arg%/g\" C:\\Users\\danedens\\bin\\payload.txt \u003e C:\\Users\\danedens\\bin\\tempfile\ngoto:eof\n\n:payloadvar\nrem Replace \"recognize\" with the first argument in the payload and output to the temp file.\nsed -e \"s/TEMP/%arg%/g\" C:\\Users\\danedens\\bin\\payloadvar.txt \u003e C:\\Users\\danedens\\bin\\tempfile\ngoto:eof\n\n:eof\nrem Copy the contents of the temporary file to the clipboard.\ncat C:\\Users\\danedens\\bin\\tempfile | clip\n\nrem Delete the temporary file.\ndel C:\\Users\\danedens\\bin\\tempfile\n\nrem Exit the batch script.\nexit /b\n```\n\n\nTo use this batch script, save it as inject.cmd in a directory that is in your PATH environment variable. Then, you can run it from the command line by typing inject.cmd \u003carg\u003e, where \u003carg\u003e is the text that you want to replace \"recognize\" with.\n\nFor example, if you run the following command:\n\n```\ninject.cmd task hello\n```\n\n  The contents of the payload.txt file will be replaced with the following:\n\n```\nvar=:=Task hello\n```\n\nIf you run the following command:\n\n```\ninject.cmd hello\n```\n\n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdanedens%2Fnode_injectors","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdanedens%2Fnode_injectors","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdanedens%2Fnode_injectors/lists"}