{"id":22473168,"url":"https://github.com/bas080/mash","last_synced_at":"2026-07-15T10:32:17.163Z","repository":{"id":147294107,"uuid":"128296771","full_name":"bas080/mash","owner":"bas080","description":"[ABANDONED] Split up and programmatically generate files","archived":false,"fork":false,"pushed_at":"2018-08-26T20:25:56.000Z","size":28,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-26T23:34:23.950Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Haskell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bas080.png","metadata":{"files":{"readme":"README.md","changelog":"ChangeLog.md","contributing":null,"funding":null,"license":"LICENSE","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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2018-04-06T03:10:21.000Z","updated_at":"2019-07-17T12:03:33.000Z","dependencies_parsed_at":null,"dependency_job_id":"a71231c1-4764-49f9-b1e8-1d7d8e0423d4","html_url":"https://github.com/bas080/mash","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/bas080/mash","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bas080%2Fmash","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bas080%2Fmash/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bas080%2Fmash/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bas080%2Fmash/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bas080","download_url":"https://codeload.github.com/bas080/mash/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bas080%2Fmash/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":35501664,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-07-15T02:00:06.706Z","response_time":131,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":"2024-12-06T12:19:58.107Z","updated_at":"2026-07-15T10:32:17.158Z","avatar_url":"https://github.com/bas080.png","language":"Haskell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# mash\n\n[![Build Status](https://travis-ci.org/bas080/mash.svg?branch=master)](https://travis-ci.org/bas080/mash)\n\nMash is a tool to replace \"require statements\" in files with the contents of\nanother.\n\n```markdown\n1 # Data structures\n2\n3 require ./chapter/linked-lists.md  \u003c 1 ## Linked lists\n                                       2\n                                       3\n4\n5\n```\n\n# Getting Started\n\nEver wanted to have a big file be split up into several files. Maybe you're\nwriting a book, or maybe you want to concatenate in very specific manner. Mash\nallows you to do this by defining a `require \u003cfile\u003e` at the start of line.\n\nEnjoy `mash` and don't abuse it.\n\n# Reason\n\nI needed a tool for building my bash scripts. I wanted to split my bash script\nup in files and then `source` whenever I needed the functions or variables\ndefined in that file.\n\nThis however only works when the user either is in the correct directory or if\na full path is used in the source statements. This would require convention or\nconfiguration.\n\nAnother reason is that it is nice to have one file be executable and working\nwhile at the same time the source code is split across several files.\n\nEven though I use Mash to write and build bash scripts, that doesn't mean it\ncan't be used for all types of things.\n\n# Usage\n\n```\nMash (C) Bas Huis\n\nmashargs [OPTIONS] [FILE/URL]\n  More flexible file concatenation\n\nCommon flags:\n  -? --help     Display help message\n  -V --version  Print version information\n\nMash helps you split up files and concat them easier\n\nTo output the generated file to stdout:\n  mash ./doc/README.md\n```\n\n```bash\ncat doc/README.md | mash - \u003e README.md\n\n# or\n\nmash doc/README.md \u003e README.md\n```\n\nYou can also have the stdout of a command substitute the require statement. To\nachieve this we use a different require statement.\n\n```\n  require-run ./mash.hs --help\n```\n\nThe stderr is not written. In case you do want to write the error, you have to\npipe the stderr to the stdout. `mash --help 2\u003e\u00261`\n\n\n# Installation\n\nFirst you need to install stack.\n\nAs mentioned in the [stack install\nguide](https://docs.haskellstack.org/en/stable/install_and_upgrade/) you can\nuse the following command to install stack.\n\n```bash\ncurl -sSL https://get.haskellstack.org/ | sh\n  # or\nwget -qO- https://get.haskellstack.org/ | sh\n```\n\nMash is a stack script. The script is located at `./mash.hs` and is executable.\nMake sure to add this script to your path by linking or copying it to a bin\ndirectory.\n\n# Test\n\nTests are writtin in bash. You can run the tests from the project directory by\ntyping the following in your terminal.\n\n`./script/test`\n\nNote that the tests require an internet connection in order to test the url\nsupport.\n\nThe tests use a \"snapshot\" to check if mash is generating documentation\ncorrectly. It uses the mash documentation to check if it does so. This means\nthat changing the mash docs results in failing tests. A minor inconvenience.\n\nTo update the snapshots simply prepend `SNAPSHOT=1`.\n\n`SNAPSHOT=1 ./script/test`\n\n# Projects\n\nAre you using mash in your project? Consider putting your project on this list.\n\n## Generating `./README.md`\n\n- https://github.com/bas080/pie\n- https://github.com/bas080/knest\n- https://github.com/bas080/mash\n\n# Roadmap\n\n## Exit with non zero when command not successfully run\n\nCurrently when a command fails it does not exit with an error code. Read more\nabout\n[ioError](http://hackage.haskell.org/package/base-4.11.1.0/docs/src/GHC.IO.Exception.html#ioError).\n\n## Better document the DSL\n\nCreate a separate paragraph for each type of require statement.\n\n- require-run\n- require\n\n# License\n\nCopyright Bas Huis (c) 2018\n\nWant to see the full [LICENSE](./LICENSE)?\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbas080%2Fmash","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbas080%2Fmash","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbas080%2Fmash/lists"}