Find a file
2023-02-11 16:06:20 +03:00
.github/workflows Create deno.yml 2023-02-11 14:15:44 +03:00
.vscode init 2023-02-10 11:17:05 +03:00
tests fix: kill/close process 2023-02-11 14:19:00 +03:00
.editorconfig add tests and command line interface 2023-02-11 14:13:48 +03:00
deno.json pick files from tar.gz and github 2023-02-10 19:30:37 +03:00
deno.lock add tests and command line interface 2023-02-11 14:13:48 +03:00
deps.ts add tests and command line interface 2023-02-11 14:13:48 +03:00
mod.d.ts add tests and command line interface 2023-02-11 14:13:48 +03:00
mod.ts fix: github tag including '@' 2023-02-11 16:06:20 +03:00
pickit.ts add help; add readme 2023-02-11 14:57:07 +03:00
readme.md fix: readme 2023-02-11 14:59:03 +03:00

Pickit

This utility helps you to extract files from tarballs and github repos using glob syntax or regular expressions. You can use either a config file or command line arguments.

Examples

Pick files from a github repo to directory scripts:

pickit nesterow/pickit@v0.0.1a scripts **/tests/*.ts

Pick files from a tarball to directory logs:

pickit server_logs.tar.gz logs **/error.log

Installation

deno install -A https://deno.land/x/pickit/pickit.ts

Using without installation

deno run -A https://deno.land/x/pickit/pickit.ts [args]...

Using config file

If you need to pick files from multiple sources, you can use a config file. The config file should exportan array of PickConfig objects.

import type { PickConfig } from "https://deno.land/x/pickit/mod.d.ts";
export default [
    {
        source: "username/repo@version",
        output: "./outputDir",
        pick: [
            /^.*/base/.*.css$/, // can be a regular expression
            "/src/index.js",
            "/src/**/*.yaml"
        ],
    },
] as PickConfig;

See the complete example here.

Usage:

pickit ./config.ts

API

Most methods are exported from mod.ts and can be used within your code. Read the API documentation

License

MIT License

Copyright (c) 2023 Pick it contributors

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

Contributors

@nesterow