├── .editorconfig ├── .github └── workflows │ └── makefile.yml ├── .gitignore ├── CONTRIBUTING.md ├── LICENSE ├── Makefile ├── README.md ├── completions └── projectdo.fish ├── docs ├── logo-dark.png ├── logo-light.png └── release.sh ├── functions ├── projectdo_build.fish ├── projectdo_run.fish ├── projectdo_test.fish └── projectdo_tool.fish ├── man ├── projectdo.1 └── projectdo.1.md ├── package.json ├── projectdo ├── run-tests.sh └── tests ├── build_script └── build.sh ├── bun-lockb ├── bun.lockb └── package.json ├── bun ├── bun.lock └── package.json ├── cargo └── Cargo.toml ├── cmake └── CMakeLists.txt ├── dotnet-csproj └── test.csproj ├── dotnet-fsproj └── test.fsproj ├── dotnet-sln └── test.sln ├── dune ├── dune ├── dune-project └── hello.ml ├── go └── go.mod ├── gradle └── build.gradle ├── just └── justfile ├── lake └── lakefile.lean ├── lein └── project.clj ├── mage ├── go.mod └── magefile.go ├── make-check-with-check-file-and-target ├── Makefile └── check ├── make-check-with-check-file ├── Makefile └── check ├── make-check └── Makefile ├── make-with-npm ├── Makefile └── package.json ├── maven └── pom.xml ├── meson ├── CMakeLists.txt ├── meson.build └── meson.c ├── nix-flake └── flake.nix ├── nix └── default.nix ├── npm-without-test ├── Makefile └── package.json ├── npm └── package.json ├── pnpm ├── package.json └── pnpm-lock.yaml ├── poetry └── pyproject.toml ├── stack ├── package.yaml └── stack.yaml ├── tectonic └── Tectonic.toml ├── uv ├── pyproject.toml └── uv.lock ├── yarn-workspace ├── package.json ├── workspace-a │ └── package.json ├── workspace-b │ └── package.json └── yarn.lock └── yarn ├── package.json └── yarn.lock /.editorconfig: -------------------------------------------------------------------------------- 1 | root = true 2 | 3 | [*] 4 | end_of_line = lf 5 | 6 | [{projectdo,*.sh,*.fish,project.json,tests/**}] 7 | indent_size = 2 8 | indent_style = space 9 | 10 | [{Makefile,justfile}] 11 | indent_style = tab 12 | -------------------------------------------------------------------------------- /.github/workflows/makefile.yml: -------------------------------------------------------------------------------- 1 | name: CI 2 | 3 | on: 4 | push: 5 | branches: ["main"] 6 | pull_request: 7 | branches: ["main"] 8 | 9 | jobs: 10 | build: 11 | runs-on: ubuntu-latest 12 | steps: 13 | - uses: actions/checkout@v4 14 | - name: Check shell files 15 | uses: luizm/action-sh-checker@master 16 | env: 17 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 18 | with: 19 | sh_checker_only_diff: true 20 | sh_checker_comment: true 21 | - name: Install tools used in tests 22 | run: | 23 | sudo apt install -y just nix-bin gradle 24 | npm install -g pnpm 25 | npm install -g bun 26 | - name: Run tests 27 | run: dash run-tests.sh 28 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | package-lock.json 2 | 3 | # Dune build artifacts in test directory 4 | tests/dune/_build/ 5 | -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # Contributing 2 | 3 | Thank you for your interest in contributing to `projectdo`! Contributions 4 | are welcome. 5 | 6 | ## Adding support for a new tool 7 | 8 | Adding support for a new tool is usually fairly straightforward by looking at 9 | how the existing tools are implemented. 10 | 11 | At a high level, the steps are: 12 | 13 | 1. Add a directory in `tests/` and populate it with a minimal setup that should 14 | be detected. 15 | 16 | ```sh 17 | mkdir tests/toolname 18 | touch tests/toolname/mytool.yaml 19 | ``` 20 | 21 | 22 | 2. Add tests in `run-tests.sh`. This is usually just copy-pasting and tweaking 23 | the tests for an existing tool. 24 | 25 | 3. Create a `try_toolname` function in the `projectdo` script. Use the existing 26 | functions for reference. 27 | 28 | 4. Call the `try_toolname` function in the `detect_and_run` function. 29 | 30 | 5. Update the documentation. 31 | - Add the tool to the list in the top of the readme and the table in the 32 | bottom of the readme. 33 | - Add the tool to the table in the man page `man/projectdo.1.md` and 34 | regenerate the man page with `make manpage` (requires Pandoc). 35 | 36 | 6. Run the test suite with `make test`. 37 | 38 | ## General coding guidelines 39 | 40 | * Stick to POSIX shell scripting features and commands (within reason). 41 | * The script is formatted using [`shfmt`](https://github.com/mvdan/sh). You can 42 | configure your editor to use this formatter or format manually using `make 43 | format`. 44 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | GNU GENERAL PUBLIC LICENSE 2 | Version 3, 29 June 2007 3 | 4 | Copyright (C) 2007 Free Software Foundation, Inc. 5 | Everyone is permitted to copy and distribute verbatim copies 6 | of this license document, but changing it is not allowed. 7 | 8 | Preamble 9 | 10 | The GNU General Public License is a free, copyleft license for 11 | software and other kinds of works. 12 | 13 | The licenses for most software and other practical works are designed 14 | to take away your freedom to share and change the works. By contrast, 15 | the GNU General Public License is intended to guarantee your freedom to 16 | share and change all versions of a program--to make sure it remains free 17 | software for all its users. We, the Free Software Foundation, use the 18 | GNU General Public License for most of our software; it applies also to 19 | any other work released this way by its authors. You can apply it to 20 | your programs, too. 21 | 22 | When we speak of free software, we are referring to freedom, not 23 | price. Our General Public Licenses are designed to make sure that you 24 | have the freedom to distribute copies of free software (and charge for 25 | them if you wish), that you receive source code or can get it if you 26 | want it, that you can change the software or use pieces of it in new 27 | free programs, and that you know you can do these things. 28 | 29 | To protect your rights, we need to prevent others from denying you 30 | these rights or asking you to surrender the rights. Therefore, you have 31 | certain responsibilities if you distribute copies of the software, or if 32 | you modify it: responsibilities to respect the freedom of others. 33 | 34 | For example, if you distribute copies of such a program, whether 35 | gratis or for a fee, you must pass on to the recipients the same 36 | freedoms that you received. You must make sure that they, too, receive 37 | or can get the source code. And you must show them these terms so they 38 | know their rights. 39 | 40 | Developers that use the GNU GPL protect your rights with two steps: 41 | (1) assert copyright on the software, and (2) offer you this License 42 | giving you legal permission to copy, distribute and/or modify it. 43 | 44 | For the developers' and authors' protection, the GPL clearly explains 45 | that there is no warranty for this free software. For both users' and 46 | authors' sake, the GPL requires that modified versions be marked as 47 | changed, so that their problems will not be attributed erroneously to 48 | authors of previous versions. 49 | 50 | Some devices are designed to deny users access to install or run 51 | modified versions of the software inside them, although the manufacturer 52 | can do so. This is fundamentally incompatible with the aim of 53 | protecting users' freedom to change the software. The systematic 54 | pattern of such abuse occurs in the area of products for individuals to 55 | use, which is precisely where it is most unacceptable. Therefore, we 56 | have designed this version of the GPL to prohibit the practice for those 57 | products. If such problems arise substantially in other domains, we 58 | stand ready to extend this provision to those domains in future versions 59 | of the GPL, as needed to protect the freedom of users. 60 | 61 | Finally, every program is threatened constantly by software patents. 62 | States should not allow patents to restrict development and use of 63 | software on general-purpose computers, but in those that do, we wish to 64 | avoid the special danger that patents applied to a free program could 65 | make it effectively proprietary. To prevent this, the GPL assures that 66 | patents cannot be used to render the program non-free. 67 | 68 | The precise terms and conditions for copying, distribution and 69 | modification follow. 70 | 71 | TERMS AND CONDITIONS 72 | 73 | 0. Definitions. 74 | 75 | "This License" refers to version 3 of the GNU General Public License. 76 | 77 | "Copyright" also means copyright-like laws that apply to other kinds of 78 | works, such as semiconductor masks. 79 | 80 | "The Program" refers to any copyrightable work licensed under this 81 | License. Each licensee is addressed as "you". "Licensees" and 82 | "recipients" may be individuals or organizations. 83 | 84 | To "modify" a work means to copy from or adapt all or part of the work 85 | in a fashion requiring copyright permission, other than the making of an 86 | exact copy. The resulting work is called a "modified version" of the 87 | earlier work or a work "based on" the earlier work. 88 | 89 | A "covered work" means either the unmodified Program or a work based 90 | on the Program. 91 | 92 | To "propagate" a work means to do anything with it that, without 93 | permission, would make you directly or secondarily liable for 94 | infringement under applicable copyright law, except executing it on a 95 | computer or modifying a private copy. Propagation includes copying, 96 | distribution (with or without modification), making available to the 97 | public, and in some countries other activities as well. 98 | 99 | To "convey" a work means any kind of propagation that enables other 100 | parties to make or receive copies. Mere interaction with a user through 101 | a computer network, with no transfer of a copy, is not conveying. 102 | 103 | An interactive user interface displays "Appropriate Legal Notices" 104 | to the extent that it includes a convenient and prominently visible 105 | feature that (1) displays an appropriate copyright notice, and (2) 106 | tells the user that there is no warranty for the work (except to the 107 | extent that warranties are provided), that licensees may convey the 108 | work under this License, and how to view a copy of this License. If 109 | the interface presents a list of user commands or options, such as a 110 | menu, a prominent item in the list meets this criterion. 111 | 112 | 1. Source Code. 113 | 114 | The "source code" for a work means the preferred form of the work 115 | for making modifications to it. "Object code" means any non-source 116 | form of a work. 117 | 118 | A "Standard Interface" means an interface that either is an official 119 | standard defined by a recognized standards body, or, in the case of 120 | interfaces specified for a particular programming language, one that 121 | is widely used among developers working in that language. 122 | 123 | The "System Libraries" of an executable work include anything, other 124 | than the work as a whole, that (a) is included in the normal form of 125 | packaging a Major Component, but which is not part of that Major 126 | Component, and (b) serves only to enable use of the work with that 127 | Major Component, or to implement a Standard Interface for which an 128 | implementation is available to the public in source code form. A 129 | "Major Component", in this context, means a major essential component 130 | (kernel, window system, and so on) of the specific operating system 131 | (if any) on which the executable work runs, or a compiler used to 132 | produce the work, or an object code interpreter used to run it. 133 | 134 | The "Corresponding Source" for a work in object code form means all 135 | the source code needed to generate, install, and (for an executable 136 | work) run the object code and to modify the work, including scripts to 137 | control those activities. However, it does not include the work's 138 | System Libraries, or general-purpose tools or generally available free 139 | programs which are used unmodified in performing those activities but 140 | which are not part of the work. For example, Corresponding Source 141 | includes interface definition files associated with source files for 142 | the work, and the source code for shared libraries and dynamically 143 | linked subprograms that the work is specifically designed to require, 144 | such as by intimate data communication or control flow between those 145 | subprograms and other parts of the work. 146 | 147 | The Corresponding Source need not include anything that users 148 | can regenerate automatically from other parts of the Corresponding 149 | Source. 150 | 151 | The Corresponding Source for a work in source code form is that 152 | same work. 153 | 154 | 2. Basic Permissions. 155 | 156 | All rights granted under this License are granted for the term of 157 | copyright on the Program, and are irrevocable provided the stated 158 | conditions are met. This License explicitly affirms your unlimited 159 | permission to run the unmodified Program. The output from running a 160 | covered work is covered by this License only if the output, given its 161 | content, constitutes a covered work. This License acknowledges your 162 | rights of fair use or other equivalent, as provided by copyright law. 163 | 164 | You may make, run and propagate covered works that you do not 165 | convey, without conditions so long as your license otherwise remains 166 | in force. You may convey covered works to others for the sole purpose 167 | of having them make modifications exclusively for you, or provide you 168 | with facilities for running those works, provided that you comply with 169 | the terms of this License in conveying all material for which you do 170 | not control copyright. Those thus making or running the covered works 171 | for you must do so exclusively on your behalf, under your direction 172 | and control, on terms that prohibit them from making any copies of 173 | your copyrighted material outside their relationship with you. 174 | 175 | Conveying under any other circumstances is permitted solely under 176 | the conditions stated below. Sublicensing is not allowed; section 10 177 | makes it unnecessary. 178 | 179 | 3. Protecting Users' Legal Rights From Anti-Circumvention Law. 180 | 181 | No covered work shall be deemed part of an effective technological 182 | measure under any applicable law fulfilling obligations under article 183 | 11 of the WIPO copyright treaty adopted on 20 December 1996, or 184 | similar laws prohibiting or restricting circumvention of such 185 | measures. 186 | 187 | When you convey a covered work, you waive any legal power to forbid 188 | circumvention of technological measures to the extent such circumvention 189 | is effected by exercising rights under this License with respect to 190 | the covered work, and you disclaim any intention to limit operation or 191 | modification of the work as a means of enforcing, against the work's 192 | users, your or third parties' legal rights to forbid circumvention of 193 | technological measures. 194 | 195 | 4. Conveying Verbatim Copies. 196 | 197 | You may convey verbatim copies of the Program's source code as you 198 | receive it, in any medium, provided that you conspicuously and 199 | appropriately publish on each copy an appropriate copyright notice; 200 | keep intact all notices stating that this License and any 201 | non-permissive terms added in accord with section 7 apply to the code; 202 | keep intact all notices of the absence of any warranty; and give all 203 | recipients a copy of this License along with the Program. 204 | 205 | You may charge any price or no price for each copy that you convey, 206 | and you may offer support or warranty protection for a fee. 207 | 208 | 5. Conveying Modified Source Versions. 209 | 210 | You may convey a work based on the Program, or the modifications to 211 | produce it from the Program, in the form of source code under the 212 | terms of section 4, provided that you also meet all of these conditions: 213 | 214 | a) The work must carry prominent notices stating that you modified 215 | it, and giving a relevant date. 216 | 217 | b) The work must carry prominent notices stating that it is 218 | released under this License and any conditions added under section 219 | 7. This requirement modifies the requirement in section 4 to 220 | "keep intact all notices". 221 | 222 | c) You must license the entire work, as a whole, under this 223 | License to anyone who comes into possession of a copy. This 224 | License will therefore apply, along with any applicable section 7 225 | additional terms, to the whole of the work, and all its parts, 226 | regardless of how they are packaged. This License gives no 227 | permission to license the work in any other way, but it does not 228 | invalidate such permission if you have separately received it. 229 | 230 | d) If the work has interactive user interfaces, each must display 231 | Appropriate Legal Notices; however, if the Program has interactive 232 | interfaces that do not display Appropriate Legal Notices, your 233 | work need not make them do so. 234 | 235 | A compilation of a covered work with other separate and independent 236 | works, which are not by their nature extensions of the covered work, 237 | and which are not combined with it such as to form a larger program, 238 | in or on a volume of a storage or distribution medium, is called an 239 | "aggregate" if the compilation and its resulting copyright are not 240 | used to limit the access or legal rights of the compilation's users 241 | beyond what the individual works permit. Inclusion of a covered work 242 | in an aggregate does not cause this License to apply to the other 243 | parts of the aggregate. 244 | 245 | 6. Conveying Non-Source Forms. 246 | 247 | You may convey a covered work in object code form under the terms 248 | of sections 4 and 5, provided that you also convey the 249 | machine-readable Corresponding Source under the terms of this License, 250 | in one of these ways: 251 | 252 | a) Convey the object code in, or embodied in, a physical product 253 | (including a physical distribution medium), accompanied by the 254 | Corresponding Source fixed on a durable physical medium 255 | customarily used for software interchange. 256 | 257 | b) Convey the object code in, or embodied in, a physical product 258 | (including a physical distribution medium), accompanied by a 259 | written offer, valid for at least three years and valid for as 260 | long as you offer spare parts or customer support for that product 261 | model, to give anyone who possesses the object code either (1) a 262 | copy of the Corresponding Source for all the software in the 263 | product that is covered by this License, on a durable physical 264 | medium customarily used for software interchange, for a price no 265 | more than your reasonable cost of physically performing this 266 | conveying of source, or (2) access to copy the 267 | Corresponding Source from a network server at no charge. 268 | 269 | c) Convey individual copies of the object code with a copy of the 270 | written offer to provide the Corresponding Source. This 271 | alternative is allowed only occasionally and noncommercially, and 272 | only if you received the object code with such an offer, in accord 273 | with subsection 6b. 274 | 275 | d) Convey the object code by offering access from a designated 276 | place (gratis or for a charge), and offer equivalent access to the 277 | Corresponding Source in the same way through the same place at no 278 | further charge. You need not require recipients to copy the 279 | Corresponding Source along with the object code. If the place to 280 | copy the object code is a network server, the Corresponding Source 281 | may be on a different server (operated by you or a third party) 282 | that supports equivalent copying facilities, provided you maintain 283 | clear directions next to the object code saying where to find the 284 | Corresponding Source. Regardless of what server hosts the 285 | Corresponding Source, you remain obligated to ensure that it is 286 | available for as long as needed to satisfy these requirements. 287 | 288 | e) Convey the object code using peer-to-peer transmission, provided 289 | you inform other peers where the object code and Corresponding 290 | Source of the work are being offered to the general public at no 291 | charge under subsection 6d. 292 | 293 | A separable portion of the object code, whose source code is excluded 294 | from the Corresponding Source as a System Library, need not be 295 | included in conveying the object code work. 296 | 297 | A "User Product" is either (1) a "consumer product", which means any 298 | tangible personal property which is normally used for personal, family, 299 | or household purposes, or (2) anything designed or sold for incorporation 300 | into a dwelling. In determining whether a product is a consumer product, 301 | doubtful cases shall be resolved in favor of coverage. For a particular 302 | product received by a particular user, "normally used" refers to a 303 | typical or common use of that class of product, regardless of the status 304 | of the particular user or of the way in which the particular user 305 | actually uses, or expects or is expected to use, the product. A product 306 | is a consumer product regardless of whether the product has substantial 307 | commercial, industrial or non-consumer uses, unless such uses represent 308 | the only significant mode of use of the product. 309 | 310 | "Installation Information" for a User Product means any methods, 311 | procedures, authorization keys, or other information required to install 312 | and execute modified versions of a covered work in that User Product from 313 | a modified version of its Corresponding Source. The information must 314 | suffice to ensure that the continued functioning of the modified object 315 | code is in no case prevented or interfered with solely because 316 | modification has been made. 317 | 318 | If you convey an object code work under this section in, or with, or 319 | specifically for use in, a User Product, and the conveying occurs as 320 | part of a transaction in which the right of possession and use of the 321 | User Product is transferred to the recipient in perpetuity or for a 322 | fixed term (regardless of how the transaction is characterized), the 323 | Corresponding Source conveyed under this section must be accompanied 324 | by the Installation Information. But this requirement does not apply 325 | if neither you nor any third party retains the ability to install 326 | modified object code on the User Product (for example, the work has 327 | been installed in ROM). 328 | 329 | The requirement to provide Installation Information does not include a 330 | requirement to continue to provide support service, warranty, or updates 331 | for a work that has been modified or installed by the recipient, or for 332 | the User Product in which it has been modified or installed. Access to a 333 | network may be denied when the modification itself materially and 334 | adversely affects the operation of the network or violates the rules and 335 | protocols for communication across the network. 336 | 337 | Corresponding Source conveyed, and Installation Information provided, 338 | in accord with this section must be in a format that is publicly 339 | documented (and with an implementation available to the public in 340 | source code form), and must require no special password or key for 341 | unpacking, reading or copying. 342 | 343 | 7. Additional Terms. 344 | 345 | "Additional permissions" are terms that supplement the terms of this 346 | License by making exceptions from one or more of its conditions. 347 | Additional permissions that are applicable to the entire Program shall 348 | be treated as though they were included in this License, to the extent 349 | that they are valid under applicable law. If additional permissions 350 | apply only to part of the Program, that part may be used separately 351 | under those permissions, but the entire Program remains governed by 352 | this License without regard to the additional permissions. 353 | 354 | When you convey a copy of a covered work, you may at your option 355 | remove any additional permissions from that copy, or from any part of 356 | it. (Additional permissions may be written to require their own 357 | removal in certain cases when you modify the work.) You may place 358 | additional permissions on material, added by you to a covered work, 359 | for which you have or can give appropriate copyright permission. 360 | 361 | Notwithstanding any other provision of this License, for material you 362 | add to a covered work, you may (if authorized by the copyright holders of 363 | that material) supplement the terms of this License with terms: 364 | 365 | a) Disclaiming warranty or limiting liability differently from the 366 | terms of sections 15 and 16 of this License; or 367 | 368 | b) Requiring preservation of specified reasonable legal notices or 369 | author attributions in that material or in the Appropriate Legal 370 | Notices displayed by works containing it; or 371 | 372 | c) Prohibiting misrepresentation of the origin of that material, or 373 | requiring that modified versions of such material be marked in 374 | reasonable ways as different from the original version; or 375 | 376 | d) Limiting the use for publicity purposes of names of licensors or 377 | authors of the material; or 378 | 379 | e) Declining to grant rights under trademark law for use of some 380 | trade names, trademarks, or service marks; or 381 | 382 | f) Requiring indemnification of licensors and authors of that 383 | material by anyone who conveys the material (or modified versions of 384 | it) with contractual assumptions of liability to the recipient, for 385 | any liability that these contractual assumptions directly impose on 386 | those licensors and authors. 387 | 388 | All other non-permissive additional terms are considered "further 389 | restrictions" within the meaning of section 10. If the Program as you 390 | received it, or any part of it, contains a notice stating that it is 391 | governed by this License along with a term that is a further 392 | restriction, you may remove that term. If a license document contains 393 | a further restriction but permits relicensing or conveying under this 394 | License, you may add to a covered work material governed by the terms 395 | of that license document, provided that the further restriction does 396 | not survive such relicensing or conveying. 397 | 398 | If you add terms to a covered work in accord with this section, you 399 | must place, in the relevant source files, a statement of the 400 | additional terms that apply to those files, or a notice indicating 401 | where to find the applicable terms. 402 | 403 | Additional terms, permissive or non-permissive, may be stated in the 404 | form of a separately written license, or stated as exceptions; 405 | the above requirements apply either way. 406 | 407 | 8. Termination. 408 | 409 | You may not propagate or modify a covered work except as expressly 410 | provided under this License. Any attempt otherwise to propagate or 411 | modify it is void, and will automatically terminate your rights under 412 | this License (including any patent licenses granted under the third 413 | paragraph of section 11). 414 | 415 | However, if you cease all violation of this License, then your 416 | license from a particular copyright holder is reinstated (a) 417 | provisionally, unless and until the copyright holder explicitly and 418 | finally terminates your license, and (b) permanently, if the copyright 419 | holder fails to notify you of the violation by some reasonable means 420 | prior to 60 days after the cessation. 421 | 422 | Moreover, your license from a particular copyright holder is 423 | reinstated permanently if the copyright holder notifies you of the 424 | violation by some reasonable means, this is the first time you have 425 | received notice of violation of this License (for any work) from that 426 | copyright holder, and you cure the violation prior to 30 days after 427 | your receipt of the notice. 428 | 429 | Termination of your rights under this section does not terminate the 430 | licenses of parties who have received copies or rights from you under 431 | this License. If your rights have been terminated and not permanently 432 | reinstated, you do not qualify to receive new licenses for the same 433 | material under section 10. 434 | 435 | 9. Acceptance Not Required for Having Copies. 436 | 437 | You are not required to accept this License in order to receive or 438 | run a copy of the Program. Ancillary propagation of a covered work 439 | occurring solely as a consequence of using peer-to-peer transmission 440 | to receive a copy likewise does not require acceptance. However, 441 | nothing other than this License grants you permission to propagate or 442 | modify any covered work. These actions infringe copyright if you do 443 | not accept this License. Therefore, by modifying or propagating a 444 | covered work, you indicate your acceptance of this License to do so. 445 | 446 | 10. Automatic Licensing of Downstream Recipients. 447 | 448 | Each time you convey a covered work, the recipient automatically 449 | receives a license from the original licensors, to run, modify and 450 | propagate that work, subject to this License. You are not responsible 451 | for enforcing compliance by third parties with this License. 452 | 453 | An "entity transaction" is a transaction transferring control of an 454 | organization, or substantially all assets of one, or subdividing an 455 | organization, or merging organizations. If propagation of a covered 456 | work results from an entity transaction, each party to that 457 | transaction who receives a copy of the work also receives whatever 458 | licenses to the work the party's predecessor in interest had or could 459 | give under the previous paragraph, plus a right to possession of the 460 | Corresponding Source of the work from the predecessor in interest, if 461 | the predecessor has it or can get it with reasonable efforts. 462 | 463 | You may not impose any further restrictions on the exercise of the 464 | rights granted or affirmed under this License. For example, you may 465 | not impose a license fee, royalty, or other charge for exercise of 466 | rights granted under this License, and you may not initiate litigation 467 | (including a cross-claim or counterclaim in a lawsuit) alleging that 468 | any patent claim is infringed by making, using, selling, offering for 469 | sale, or importing the Program or any portion of it. 470 | 471 | 11. Patents. 472 | 473 | A "contributor" is a copyright holder who authorizes use under this 474 | License of the Program or a work on which the Program is based. The 475 | work thus licensed is called the contributor's "contributor version". 476 | 477 | A contributor's "essential patent claims" are all patent claims 478 | owned or controlled by the contributor, whether already acquired or 479 | hereafter acquired, that would be infringed by some manner, permitted 480 | by this License, of making, using, or selling its contributor version, 481 | but do not include claims that would be infringed only as a 482 | consequence of further modification of the contributor version. For 483 | purposes of this definition, "control" includes the right to grant 484 | patent sublicenses in a manner consistent with the requirements of 485 | this License. 486 | 487 | Each contributor grants you a non-exclusive, worldwide, royalty-free 488 | patent license under the contributor's essential patent claims, to 489 | make, use, sell, offer for sale, import and otherwise run, modify and 490 | propagate the contents of its contributor version. 491 | 492 | In the following three paragraphs, a "patent license" is any express 493 | agreement or commitment, however denominated, not to enforce a patent 494 | (such as an express permission to practice a patent or covenant not to 495 | sue for patent infringement). To "grant" such a patent license to a 496 | party means to make such an agreement or commitment not to enforce a 497 | patent against the party. 498 | 499 | If you convey a covered work, knowingly relying on a patent license, 500 | and the Corresponding Source of the work is not available for anyone 501 | to copy, free of charge and under the terms of this License, through a 502 | publicly available network server or other readily accessible means, 503 | then you must either (1) cause the Corresponding Source to be so 504 | available, or (2) arrange to deprive yourself of the benefit of the 505 | patent license for this particular work, or (3) arrange, in a manner 506 | consistent with the requirements of this License, to extend the patent 507 | license to downstream recipients. "Knowingly relying" means you have 508 | actual knowledge that, but for the patent license, your conveying the 509 | covered work in a country, or your recipient's use of the covered work 510 | in a country, would infringe one or more identifiable patents in that 511 | country that you have reason to believe are valid. 512 | 513 | If, pursuant to or in connection with a single transaction or 514 | arrangement, you convey, or propagate by procuring conveyance of, a 515 | covered work, and grant a patent license to some of the parties 516 | receiving the covered work authorizing them to use, propagate, modify 517 | or convey a specific copy of the covered work, then the patent license 518 | you grant is automatically extended to all recipients of the covered 519 | work and works based on it. 520 | 521 | A patent license is "discriminatory" if it does not include within 522 | the scope of its coverage, prohibits the exercise of, or is 523 | conditioned on the non-exercise of one or more of the rights that are 524 | specifically granted under this License. You may not convey a covered 525 | work if you are a party to an arrangement with a third party that is 526 | in the business of distributing software, under which you make payment 527 | to the third party based on the extent of your activity of conveying 528 | the work, and under which the third party grants, to any of the 529 | parties who would receive the covered work from you, a discriminatory 530 | patent license (a) in connection with copies of the covered work 531 | conveyed by you (or copies made from those copies), or (b) primarily 532 | for and in connection with specific products or compilations that 533 | contain the covered work, unless you entered into that arrangement, 534 | or that patent license was granted, prior to 28 March 2007. 535 | 536 | Nothing in this License shall be construed as excluding or limiting 537 | any implied license or other defenses to infringement that may 538 | otherwise be available to you under applicable patent law. 539 | 540 | 12. No Surrender of Others' Freedom. 541 | 542 | If conditions are imposed on you (whether by court order, agreement or 543 | otherwise) that contradict the conditions of this License, they do not 544 | excuse you from the conditions of this License. If you cannot convey a 545 | covered work so as to satisfy simultaneously your obligations under this 546 | License and any other pertinent obligations, then as a consequence you may 547 | not convey it at all. For example, if you agree to terms that obligate you 548 | to collect a royalty for further conveying from those to whom you convey 549 | the Program, the only way you could satisfy both those terms and this 550 | License would be to refrain entirely from conveying the Program. 551 | 552 | 13. Use with the GNU Affero General Public License. 553 | 554 | Notwithstanding any other provision of this License, you have 555 | permission to link or combine any covered work with a work licensed 556 | under version 3 of the GNU Affero General Public License into a single 557 | combined work, and to convey the resulting work. The terms of this 558 | License will continue to apply to the part which is the covered work, 559 | but the special requirements of the GNU Affero General Public License, 560 | section 13, concerning interaction through a network will apply to the 561 | combination as such. 562 | 563 | 14. Revised Versions of this License. 564 | 565 | The Free Software Foundation may publish revised and/or new versions of 566 | the GNU General Public License from time to time. Such new versions will 567 | be similar in spirit to the present version, but may differ in detail to 568 | address new problems or concerns. 569 | 570 | Each version is given a distinguishing version number. If the 571 | Program specifies that a certain numbered version of the GNU General 572 | Public License "or any later version" applies to it, you have the 573 | option of following the terms and conditions either of that numbered 574 | version or of any later version published by the Free Software 575 | Foundation. If the Program does not specify a version number of the 576 | GNU General Public License, you may choose any version ever published 577 | by the Free Software Foundation. 578 | 579 | If the Program specifies that a proxy can decide which future 580 | versions of the GNU General Public License can be used, that proxy's 581 | public statement of acceptance of a version permanently authorizes you 582 | to choose that version for the Program. 583 | 584 | Later license versions may give you additional or different 585 | permissions. However, no additional obligations are imposed on any 586 | author or copyright holder as a result of your choosing to follow a 587 | later version. 588 | 589 | 15. Disclaimer of Warranty. 590 | 591 | THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY 592 | APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT 593 | HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY 594 | OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, 595 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 596 | PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM 597 | IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF 598 | ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 599 | 600 | 16. Limitation of Liability. 601 | 602 | IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING 603 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS 604 | THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY 605 | GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE 606 | USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF 607 | DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD 608 | PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), 609 | EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF 610 | SUCH DAMAGES. 611 | 612 | 17. Interpretation of Sections 15 and 16. 613 | 614 | If the disclaimer of warranty and limitation of liability provided 615 | above cannot be given local legal effect according to their terms, 616 | reviewing courts shall apply local law that most closely approximates 617 | an absolute waiver of all civil liability in connection with the 618 | Program, unless a warranty or assumption of liability accompanies a 619 | copy of the Program in return for a fee. 620 | 621 | END OF TERMS AND CONDITIONS 622 | 623 | How to Apply These Terms to Your New Programs 624 | 625 | If you develop a new program, and you want it to be of the greatest 626 | possible use to the public, the best way to achieve this is to make it 627 | free software which everyone can redistribute and change under these terms. 628 | 629 | To do so, attach the following notices to the program. It is safest 630 | to attach them to the start of each source file to most effectively 631 | state the exclusion of warranty; and each file should have at least 632 | the "copyright" line and a pointer to where the full notice is found. 633 | 634 | 635 | Copyright (C) 636 | 637 | This program is free software: you can redistribute it and/or modify 638 | it under the terms of the GNU General Public License as published by 639 | the Free Software Foundation, either version 3 of the License, or 640 | (at your option) any later version. 641 | 642 | This program is distributed in the hope that it will be useful, 643 | but WITHOUT ANY WARRANTY; without even the implied warranty of 644 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 645 | GNU General Public License for more details. 646 | 647 | You should have received a copy of the GNU General Public License 648 | along with this program. If not, see . 649 | 650 | Also add information on how to contact you by electronic and paper mail. 651 | 652 | If the program does terminal interaction, make it output a short 653 | notice like this when it starts in an interactive mode: 654 | 655 | Copyright (C) 656 | This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. 657 | This is free software, and you are welcome to redistribute it 658 | under certain conditions; type `show c' for details. 659 | 660 | The hypothetical commands `show w' and `show c' should show the appropriate 661 | parts of the General Public License. Of course, your program's commands 662 | might be different; for a GUI interface, you would use an "about box". 663 | 664 | You should also get your employer (if you work as a programmer) or school, 665 | if any, to sign a "copyright disclaimer" for the program, if necessary. 666 | For more information on this, and how to apply and follow the GNU GPL, see 667 | . 668 | 669 | The GNU General Public License does not permit incorporating your program 670 | into proprietary programs. If your program is a subroutine library, you 671 | may consider it more useful to permit linking proprietary applications with 672 | the library. If this is what you want to do, use the GNU Lesser General 673 | Public License instead of this License. But first, please read 674 | . 675 | -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | PREFIX ?= /usr 2 | MANDIR = $(PREFIX)/share/man 3 | BINARY_NAME = projectdo 4 | 5 | all: 6 | @echo RUN \'make install\' to install $(BINARY_NAME) 7 | @echo RUN \'make uninstall\' to uninstall $(BINARY_NAME) 8 | @echo RUN \'make manpage\' to generate manpage for $(BINARY_NAME) 9 | @echo RUN \'make test\' to run tests for $(BINARY_NAME) 10 | 11 | install: 12 | @mkdir -p $(DESTDIR)$(PREFIX)/bin 13 | @install -Dm755 $(BINARY_NAME) $(DESTDIR)$(PREFIX)/bin/$(BINARY_NAME) 14 | @mkdir -p $(DESTDIR)$(MANDIR)/man1 15 | @cp -p man/$(BINARY_NAME).1 $(DESTDIR)$(MANDIR)/man1 16 | 17 | manpage: 18 | @if [ -n "$(shell command -v pandoc)" ]; then \ 19 | pandoc --standalone --to man man/$(BINARY_NAME).1.md --output man/$(BINARY_NAME).1; \ 20 | echo "SUCCESS: manpage generated"; \ 21 | else \ 22 | echo "ERROR: could not generate manpage. Pandoc not found."; \ 23 | fi 24 | 25 | release: 26 | @sh -c docs/release.sh 27 | 28 | uninstall: 29 | @rm -f $(DESTDIR)$(PREFIX)/bin/$(BINARY_NAME) 30 | @rm -rf $(DESTDIR)$(MANDIR)/man1/$(BINARY_NAME).1* 31 | 32 | test: 33 | sh run-tests.sh 34 | 35 | format: 36 | @if [ -n "$(shell command -v shfmt)" ]; then \ 37 | shfmt -w projectdo run-tests.sh; \ 38 | else \ 39 | echo "ERROR: could not format scripts. shfmt not found."; \ 40 | fi 41 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 |
2 | 3 | 4 | 5 |
6 | 7 | 8 | 9 | projectdo logo 10 | 11 | 12 | Context-aware single-letter project commands to speed up your command-line workflow. 13 | 14 | *   🏗   b to build/compile any project. 15 | *   🚀   r to run/start any project. 16 | *   🧪   t to test any project. 17 | 18 | https://user-images.githubusercontent.com/521604/231857437-12c14aff-585d-4817-8f44-59b40ecc32e0.mov 19 | 20 | * **Supports over 20 build and project tools** – Bun, Cabal, Cargo, CMake, .NET, 21 | Dune, Go, Gradle, Lake, Leiningen, Mage, Maven, Meson, Poetry, Stack, Tectonic, 22 | just, make, nix, npm, pnpm, and yarn. [More 23 | details](#supported-tools-and-languages). 24 | * **Portable** – Dependency-free portable POSIX shell script. Supports Linux, 25 | macOS, WSL, etc. 26 | * **Shell Integration** – Works with aliases in any shell and for the Fish 27 | shell through a [Fish plugin](#fish-plugin). 28 | * **Simple** – Easy to extend with support for new tools. 29 | 30 | ## Why & What 31 | 32 | If you're a developer and command line user, you're probably constantly using 33 | commands like `make`, `cargo run`, `npm test`, etc. The common approach of 34 | using shell aliases to provide shorthand forms for frequently used commands does 35 | not work well in these cases. For example, creating an alias like `b` for `cargo 36 | build` one day is completely useless the next day when working in a project 37 | that uses a different build tool. 38 | 39 | `projectdo` solves that problem. It executes project actions (such as build, 40 | run, test, etc.) with the appropriate tool for the project in the current 41 | working directory. The appropriate tool is intelligently detected based on the 42 | context where `projectdo` is executed. For instance, `projectdo test` runs 43 | `cargo test` if a `Cargo.toml` is found and `npm test` if a `package.json` file 44 | is found. 45 | 46 | By combining `projectdo` with shell aliases, project commands can be run in any 47 | project with minimal typing. As an example, with the alias `alias b='projectdo 48 | build'`, you can build any project simply by typing 49 | b+enter. 50 | 51 | ## Install 52 | 53 | `projectdo` can be installed through a number of package managers or by 54 | manually downloading the shell script. 55 | 56 | ### Homebrew 57 | 58 | `projectdo` can be installed with Homebrew on macOS and Linux. 59 | 60 | ``` 61 | brew install paldepind/tap/projectdo 62 | ``` 63 | 64 | ### AUR (Arch Linux) 65 | 66 | The [AUR package](https://aur.archlinux.org/packages/projectdo) can be installed manually or using an AUR helper. 67 | 68 | ```sh 69 | yay -S projectdo 70 | ``` 71 | 72 | ### npm 73 | 74 | `projectdo` is not related to Node.js or JavaScript, but npm works perfectly 75 | fine for distributing shell scripts and can be a handy installation method if 76 | you're already using npm: 77 | 78 | ```sh 79 | npm i -g projectdo 80 | ``` 81 | 82 | ### From source 83 | 84 | Download the script and place it somewhere in your path. For instance if 85 | `~/bin` is in your path: 86 | 87 | ``` 88 | curl https://raw.githubusercontent.com/paldepind/projectdo/main/projectdo -o ~/bin/projectdo 89 | chmod +x ~/bin/projectdo 90 | ``` 91 | 92 | #### From repository 93 | 94 | Clone the project repository: 95 | 96 | ```sh 97 | git clone https://github.com/paldepind/projectdo; cd projectdo 98 | ``` 99 | 100 | Install it with this command: 101 | 102 | ```sh 103 | make install 104 | 105 | # Or to uninstall 106 | make uninstall 107 | ``` 108 | 109 | ## Shell integration 110 | 111 | For the Fish shell use [the Fish plugin](#fish-plugin). For Bash and Zsh setup 112 | [shell aliases](#aliases). 113 | 114 | ### Fish Plugin 115 | 116 | `projectdo` ships with a plugin for the Fish shell. The plugin includes 117 | auto-completion and functions for use with Fish's abbreviation feature. 118 | 119 | The Fish plugin can be installed manually or with 120 | [Fisher](https://github.com/jorgebucaran/fisher): 121 | 122 | ``` 123 | fisher install paldepind/projectdo 124 | ``` 125 | 126 | The plugin exposes four shell functions that should be configured with 127 | abbreviations as desired. For instance: 128 | 129 | ``` 130 | abbr -a b --function projectdo_build 131 | abbr -a r --function projectdo_run 132 | abbr -a t --function projectdo_test 133 | abbr -a p --function projectdo_tool 134 | ``` 135 | 136 | With the above configuration, `t` will expand to `cargo test`, `p` will expand to `cargo`, 137 | etc. depending on the project. 138 | 139 | _Note that you need to have the script in your path in order for the Fish plugin to work!_ 140 | 141 | ### Aliases 142 | 143 | `projectdo` can be configured with shell aliases in any shell. For instance: 144 | 145 | ```sh 146 | alias t='projectdo test' 147 | alias r='projectdo run' 148 | alias b='projectdo build' 149 | alias p='projectdo tool' 150 | ``` 151 | 152 | ## Usage 153 | 154 | **Note**: When executed with the `-d` flag, `projectdo` performs a dry run and 155 | only prints information about what it would do without actually doing anything. 156 | It is a good idea to do a dry run when using `projectdo` in a project for the 157 | first time to verify that it does the right thing. 158 | 159 | ``` 160 | Usage: projectdo [options] [action] [tool-arguments] 161 | Options: 162 | -h, --help Display this help. 163 | -n, -d, --dry-run Do not execute any commands with side-effects. 164 | -q, --quiet Do not print commands as they are about to be executed. 165 | -v, --version Display the version of the program. 166 | 167 | Actions: 168 | build, run, test Build, run, or test the current project. 169 | tool Invoke the guessed tool for the current project. 170 | 171 | Tool arguments: 172 | Any arguments following [action] are passed along to the invoked tool. 173 | ``` 174 | 175 | ## Supported tools and languages 176 | 177 | **Note:** If a tool you're interested in is not supported, please open an issue or a pull 178 | request. 179 | 180 | | Tool | Language | Detected by | Commands | 181 | |-----------------|------------------|--------------------------------------------|---------------------------------------------------------| 182 | | bun | JavaScript, etc | `package.json` and `bun.lock`/`bun.lockb` | `bun build`
`bun start`
`bun test` | 183 | | Cabal | Haskell | `*.cabal` | `cabal build`
`cabal run`
`cabal test` | 184 | | Cargo | Rust | `Cargo.toml` | `cargo build`
`cargo run`
`cargo test` | 185 | | CMake | C, C++ and Obj-C | `CMakeLists.txt` | `cmake --build . --target test` | 186 | | Dune | OCaml | `dune-project` | `dune build`
`dune exec`
`dune runtest` | 187 | | Go | Go | `go.mod` | `go test` | 188 | | Gradle | Java, etc. | `build.gradle` or `build.gradle.kts` | `gradle compile`
`gradle run`
`gradle test` | 189 | | just | Any | `justfile` | `just build`
`just run`
`just test` | 190 | | Lake | Lean | `lakefile.lean` or `lake-manifest.json` | `lake build`
`lake run`
`lake test` | 191 | | Leiningen | Clojure | `project.clj` | `lein test` | 192 | | Mage | Go | `magefile.go` with a `test`/`check` target | `mage test/check` | 193 | | make | Any | `Makefile` | `make`
`make test/check` | 194 | | Maven | Java, etc. | `pom.xml` | `mvn compile`
run n/a
`mvn test` | 195 | | Meson | C, C++, etc. | `meson.build` | `meson compile`
run n/a
`meson test` | 196 | | .NET | C# and F# | `*.csproj`, `*.fsproj` or `*.sln` | `dotnet build`
`dotnet run`
`dotnet test` | 197 | | nix (flake) | nix | `flake.nix` | `nix build`
`nix run`
`nix flake check` | 198 | | nix (non-flake) | nix | `default.nix` | `nix-build` | 199 | | npm | JavaScript, etc. | `package.json` | `npm build`
`npm start`
`npm test` | 200 | | pnpm | JavaScript, etc | `package.json` and `pnpm-lock.yaml` | `pnpm build`
`pnpm start`
`pnpm test` | 201 | | Poetry | Python | `pyproject.toml` with `[tool.poetry]` | `poetry build`
run n/a
`poetry run pytest` | 202 | | Shell script | Any | `build.sh` | `sh -c build.sh` | 203 | | Stack | Haskell | `stack.yaml` | `stack build`
`stack run`
`stack test` | 204 | | Tectonic | LaTeX | `Tectonic.toml` | `tectonic -X build` | 205 | | yarn | JavaScript, etc. | `package.json` and `yarn.lock` | `yarn build`
`yarn start`
`yarn test` | 206 | -------------------------------------------------------------------------------- /completions/projectdo.fish: -------------------------------------------------------------------------------- 1 | complete -c projectdo --no-files 2 | 3 | set -l commands build run test tool 4 | 5 | # Options 6 | complete -c projectdo -n "not __fish_seen_subcommand_from $commands" \ 7 | -s h -l help -d 'Display usage information' 8 | complete -c projectdo -n "not __fish_seen_subcommand_from $commands" \ 9 | -s d -l 'dry-run' -d 'Do not execute any commands with side-effects' 10 | complete -c projectdo -n "not __fish_seen_subcommand_from $commands" \ 11 | -s q -l quiet -d 'Do not print commands before execution' 12 | complete -c projectdo -n "not __fish_seen_subcommand_from $commands" \ 13 | -s v -l version -d 'Dsiplay the version' 14 | 15 | # Actions 16 | complete -c projectdo -n "not __fish_seen_subcommand_from $commands" \ 17 | -a build -d 'Build the current project' 18 | complete -c projectdo -n "not __fish_seen_subcommand_from $commands" \ 19 | -a run -d 'Run the current project' 20 | complete -c projectdo -n "not __fish_seen_subcommand_from $commands" \ 21 | -a test -d 'Test the current project' 22 | complete -c projectdo -n "not __fish_seen_subcommand_from $commands" \ 23 | -a tool -d 'Invoke the tool corresponding to the current project' 24 | -------------------------------------------------------------------------------- /docs/logo-dark.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/paldepind/projectdo/d2b3059e252f7e153695355b25ca103fc4233c14/docs/logo-dark.png -------------------------------------------------------------------------------- /docs/logo-light.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/paldepind/projectdo/d2b3059e252f7e153695355b25ca103fc4233c14/docs/logo-light.png -------------------------------------------------------------------------------- /docs/release.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | set -e 3 | 4 | # Exit if the git working directory is dirty 5 | if [ -n "$(git status --porcelain)" ]; then 6 | echo "Git working directory is dirty." 7 | echo "" 8 | echo "Please commit or stash your changes before creating a release." 9 | exit 1 10 | fi 11 | 12 | # Store current dir 13 | old_dir=$(pwd) 14 | 15 | # Get docs directoy the POSIX way 16 | DOCS_PATH="$0" 17 | if [ ! -e "$DOCS_PATH" ]; then 18 | case $DOCS_PATH in 19 | */*) exit 1 ;; 20 | *) DOCS_PATH=$(command -v -- "$DOCS_PATH") || exit ;; 21 | esac 22 | fi 23 | docs_dir=$( 24 | cd -P -- "$(dirname -- "$DOCS_PATH")" && pwd -P 25 | ) || exit 26 | 27 | # Go into docs dir 28 | cd "$docs_dir" 29 | cd .. 30 | 31 | # Define other dirs 32 | project_dir=$(pwd) 33 | man_dir="${project_dir}/man" 34 | 35 | date=$(date '+%B %d, %Y') 36 | version=$(sh -c "${project_dir}/./projectdo --version" | grep -Eo '[0-9]\.[0-9]\.[0-9]+') 37 | 38 | printf '%s is the current projectdo version.\n' "$version" 39 | printf "What version do you want to change it to?\n: " 40 | read -r ver_choice 41 | 42 | ex -sc "%s/date\:.*/date: $date/g" -c 'x' "${man_dir}/projectdo.1.md" 43 | 44 | ex -sc "%s/VERSION=.*/VERSION=\"$ver_choice\"/" -c 'x' "${project_dir}/./projectdo" 45 | printf 'Successfully updated version number to %s in projectdo.\n' "$ver_choice" 46 | 47 | ex -sc "%s/\"version\": \"[^\"]*\"/\"version\": \"$ver_choice\"/g" -c 'x' "${project_dir}/package.json" 48 | printf 'Successfully updated version number to %s in package.json.\n' "$ver_choice" 49 | 50 | ex -sc "%s/footer\:.*/footer: projectdo $ver_choice/" -c 'x' "${man_dir}/projectdo.1.md" 51 | printf 'Successfully updated version number to %s in projectdo.1.md\n' "$ver_choice" 52 | 53 | printf "Do you want to generate new manpage?\n[Y/n]: " 54 | read -r man_choice 55 | if ! [ "$man_choice" = "n" ]; then 56 | make manpage 57 | fi 58 | 59 | printf "Creating a git commit and tag for version %s.\n" "$ver_choice" 60 | git add -u 61 | git commit -m "Release version $ver_choice" 62 | git tag "v$ver_choice" 63 | 64 | printf "Check that everything looks ok, then push with:\n" 65 | printf " git push origin\n" 66 | printf " git push origin tag v%s\n" "$ver_choice" 67 | 68 | printf "and create a new release on GitHub:\n" 69 | printf " https://github.com/paldepind/projectdo/releases/new?title=%s&tag=v%s\n" "$ver_choice" "$ver_choice" 70 | 71 | # Go back to the dir where user was before 72 | cd "$old_dir" 73 | 74 | exit 0 75 | -------------------------------------------------------------------------------- /functions/projectdo_build.fish: -------------------------------------------------------------------------------- 1 | function projectdo_build 2 | projectdo -d build 3 | end 4 | -------------------------------------------------------------------------------- /functions/projectdo_run.fish: -------------------------------------------------------------------------------- 1 | function projectdo_run 2 | projectdo -d run 3 | end 4 | -------------------------------------------------------------------------------- /functions/projectdo_test.fish: -------------------------------------------------------------------------------- 1 | function projectdo_test 2 | projectdo -d test 3 | end 4 | -------------------------------------------------------------------------------- /functions/projectdo_tool.fish: -------------------------------------------------------------------------------- 1 | function projectdo_tool 2 | projectdo -d tool 3 | end 4 | -------------------------------------------------------------------------------- /man/projectdo.1: -------------------------------------------------------------------------------- 1 | '\" t 2 | .\" Automatically generated by Pandoc 3.6.4 3 | .\" 4 | .TH "projectdo" "1" "September 14, 2025" "projectdo 1.0.1" "User Manual" 5 | .SH NAME 6 | projectdo \- build, run, test, and more with ease 7 | .SH SYNOPSIS 8 | \f[B]projectdo\f[R] [\f[I]OPTION\f[R]] [\f[I]ACTION\f[R]] \&... 9 | .SH DESCRIPTION 10 | projectdo is a command\-line program that executes project actions (such 11 | as build, run, test, etc.) 12 | with the appropriate tool for current project in the working directory. 13 | The appropriate tool and the current project root is intelligently 14 | detected based on the context where projectdo is executed. 15 | For instance, projectdo test runs cargo test if a Cargo.toml is found 16 | and npm test if a package.json file is found. 17 | .SH OPTIONS 18 | .TP 19 | \f[B]\-h, \f[CB]\-\-\f[B]help\f[R] 20 | display help message 21 | .TP 22 | \f[B]\-n, \-d, \f[CB]\-\-\f[B]dry\-run\f[R] 23 | do not execute any commands with side\-effects 24 | .TP 25 | \f[B]\-q, \f[CB]\-\-\f[B]quiet\f[R] 26 | do not print commands as they are about to be executed 27 | .TP 28 | \f[B]\-v, \f[CB]\-\-\f[B]version\f[R] 29 | prints installed projectdo version. 30 | .SH ACTIONS 31 | .TP 32 | \f[B]build\f[R] 33 | build project in working directory 34 | .TP 35 | \f[B]run\f[R] 36 | run the project in working directory 37 | .TP 38 | \f[B]test\f[R] 39 | test the project in working directory 40 | .TP 41 | \f[B]tool\f[R] 42 | Invoke the guessed tool for the current project 43 | .SH TOOL ARGUMENTS 44 | Any arguments following [action] are passed along to the invoked tool. 45 | .SH SHELL INTEGRATION 46 | .SS FISH 47 | projectdo ships with a plugin for the Fish shell. 48 | The plugin includes auto\-completion and functions for use with 49 | Fish\[cq]s abbreviation feature. 50 | .PP 51 | The Fish plugin can be installed manually or with Fisher (fish plugin 52 | manager): \f[CR]fisher install paldepind/projectdo\f[R] 53 | .PP 54 | The plugin exposes four shell functions that should be configured with 55 | abbreviations as desired. 56 | For instance: 57 | .IP 58 | .EX 59 | abbr \-a b \-\-function projectdo_build 60 | abbr \-a r \-\-function projectdo_run 61 | abbr \-a t \-\-function projectdo_test 62 | abbr \-a p \-\-function projectdo_tool 63 | .EE 64 | .PP 65 | With the above \f[CR]t\f[R] will expand to \f[CR]cargo test\f[R], 66 | \f[CR]p\f[R] will expand to \f[CR]cargo\f[R], etc. 67 | depending on the project. 68 | .SS BASH + OTHERS 69 | projectdo can be configured with shell aliases in any shell. 70 | For instance: 71 | .IP 72 | .EX 73 | alias t=\[aq]projectdo test\[aq] 74 | alias r=\[aq]projectdo run\[aq] 75 | alias b=\[aq]projectdo build\[aq] 76 | alias p=\[aq]projectdo tool\[aq] 77 | .EE 78 | .SH SUPPORTED TOOLS AND LANGUAGES 79 | .PP 80 | .TS 81 | tab(@); 82 | lw(8.8n) lw(9.3n) lw(22.8n) lw(29.0n). 83 | T{ 84 | Tool 85 | T}@T{ 86 | Language 87 | T}@T{ 88 | Detected by 89 | T}@T{ 90 | Commands 91 | T} 92 | _ 93 | .TE 94 | .PP 95 | .TS 96 | tab(@); 97 | lw(8.8n) lw(9.3n) lw(22.8n) lw(29.0n). 98 | T{ 99 | bun 100 | T}@T{ 101 | JavaScript, etc 102 | T}@T{ 103 | \f[CR]package.json\f[R] and \f[CR]bun.lock\f[R]/\f[CR]bun.lockb\f[R] 104 | T}@T{ 105 | \f[CR]bun build\f[R], \f[CR]bun start\f[R], \f[CR]bun test\f[R] 106 | T} 107 | _ 108 | .TE 109 | .PP 110 | .TS 111 | tab(@); 112 | lw(8.8n) lw(9.3n) lw(22.8n) lw(29.0n). 113 | T{ 114 | Cabal 115 | T}@T{ 116 | Haskell 117 | T}@T{ 118 | \f[CR]*.cabal\f[R] 119 | T}@T{ 120 | \f[CR]cabal build\f[R], \f[CR]cabal run\f[R], \f[CR]cabal test\f[R] 121 | T} 122 | _ 123 | .TE 124 | .PP 125 | .TS 126 | tab(@); 127 | lw(8.8n) lw(9.3n) lw(22.8n) lw(29.0n). 128 | T{ 129 | Cargo 130 | T}@T{ 131 | Rust 132 | T}@T{ 133 | \f[CR]Cargo.toml\f[R] 134 | T}@T{ 135 | \f[CR]cargo build\f[R], \f[CR]cargo run\f[R], \f[CR]cargo test\f[R] 136 | T} 137 | _ 138 | .TE 139 | .PP 140 | .TS 141 | tab(@); 142 | lw(8.8n) lw(9.3n) lw(22.8n) lw(29.0n). 143 | T{ 144 | CMake 145 | T}@T{ 146 | C, C++ and Obj\-C 147 | T}@T{ 148 | \f[CR]CMakeLists.txt\f[R] 149 | T}@T{ 150 | \f[CR]cmake \-\-build . \-\-target test\f[R] 151 | T} 152 | _ 153 | .TE 154 | .PP 155 | .TS 156 | tab(@); 157 | lw(8.8n) lw(9.3n) lw(22.8n) lw(29.0n). 158 | T{ 159 | Dune 160 | T}@T{ 161 | OCaml 162 | T}@T{ 163 | \f[CR]dune\-project\f[R] 164 | T}@T{ 165 | \f[CR]dune build\f[R], \f[CR]dune exec\f[R], \f[CR]dune runtest\f[R] 166 | T} 167 | _ 168 | .TE 169 | .PP 170 | .TS 171 | tab(@); 172 | lw(8.8n) lw(9.3n) lw(22.8n) lw(29.0n). 173 | T{ 174 | Go 175 | T}@T{ 176 | Go 177 | T}@T{ 178 | \f[CR]go.mod\f[R] 179 | T}@T{ 180 | \f[CR]go test\f[R] 181 | T} 182 | _ 183 | .TE 184 | .PP 185 | .TS 186 | tab(@); 187 | lw(8.8n) lw(9.3n) lw(22.8n) lw(29.0n). 188 | T{ 189 | Gradle 190 | T}@T{ 191 | Java, etc. 192 | T}@T{ 193 | \f[CR]build.gradle\f[R] or \f[CR]build.gradle.kts\f[R] 194 | T}@T{ 195 | \f[CR]gradle compile\f[R], \f[CR]gradle run\f[R], \f[CR]gradle test\f[R] 196 | T} 197 | _ 198 | .TE 199 | .PP 200 | .TS 201 | tab(@); 202 | lw(8.8n) lw(9.3n) lw(22.8n) lw(29.0n). 203 | T{ 204 | just 205 | T}@T{ 206 | Any 207 | T}@T{ 208 | \f[CR]justfile\f[R] 209 | T}@T{ 210 | \f[CR]just build\f[R], \f[CR]just run\f[R], \f[CR]just test\f[R] 211 | T} 212 | _ 213 | .TE 214 | .PP 215 | .TS 216 | tab(@); 217 | lw(8.8n) lw(9.3n) lw(22.8n) lw(29.0n). 218 | T{ 219 | Lake 220 | T}@T{ 221 | Lean 222 | T}@T{ 223 | \f[CR]lakefile.lean\f[R] or \f[CR]lakefile.toml\f[R] 224 | T}@T{ 225 | \f[CR]lake build\f[R], \f[CR]lake run\f[R], \f[CR]lake test\f[R] 226 | T} 227 | _ 228 | .TE 229 | .PP 230 | .TS 231 | tab(@); 232 | lw(8.8n) lw(9.3n) lw(22.8n) lw(29.0n). 233 | T{ 234 | Leiningen 235 | T}@T{ 236 | Clojure 237 | T}@T{ 238 | \f[CR]project.clj\f[R] 239 | T}@T{ 240 | \f[CR]lein test\f[R] 241 | T} 242 | _ 243 | .TE 244 | .PP 245 | .TS 246 | tab(@); 247 | lw(8.8n) lw(9.3n) lw(22.8n) lw(29.0n). 248 | T{ 249 | Mage 250 | T}@T{ 251 | Go 252 | T}@T{ 253 | \f[CR]magefile.go\f[R] with a \f[CR]test\f[R]/\f[CR]check\f[R] target 254 | T}@T{ 255 | \f[CR]mage test/check\f[R] 256 | T} 257 | _ 258 | .TE 259 | .PP 260 | .TS 261 | tab(@); 262 | lw(8.8n) lw(9.3n) lw(22.8n) lw(29.0n). 263 | T{ 264 | make 265 | T}@T{ 266 | Any 267 | T}@T{ 268 | \f[CR]Makefile\f[R] 269 | T}@T{ 270 | \f[CR]make\f[R], \f[CR]make test/check\f[R] 271 | T} 272 | _ 273 | .TE 274 | .PP 275 | .TS 276 | tab(@); 277 | lw(8.8n) lw(9.3n) lw(22.8n) lw(29.0n). 278 | T{ 279 | Maven 280 | T}@T{ 281 | Java, etc. 282 | T}@T{ 283 | \f[CR]pom.xml\f[R] 284 | T}@T{ 285 | \f[CR]mvn compile\f[R], run n/a, \f[CR]mvn test\f[R] 286 | T} 287 | _ 288 | .TE 289 | .PP 290 | .TS 291 | tab(@); 292 | lw(8.8n) lw(9.3n) lw(22.8n) lw(29.0n). 293 | T{ 294 | Meson 295 | T}@T{ 296 | C, C++, etc. 297 | T}@T{ 298 | \f[CR]meson.build\f[R] 299 | T}@T{ 300 | \f[CR]meson compile\f[R], run n/a, \f[CR]meson test\f[R] 301 | T} 302 | _ 303 | .TE 304 | .PP 305 | .TS 306 | tab(@); 307 | lw(8.8n) lw(9.3n) lw(22.8n) lw(29.0n). 308 | T{ 309 | \&.NET 310 | T}@T{ 311 | C# and F# 312 | T}@T{ 313 | \f[CR]*.csproj\f[R], \f[CR]*.fsproj\f[R] or \f[CR]*.sln\f[R] 314 | T}@T{ 315 | \f[CR]dotnet build\f[R], \f[CR]dotnet run\f[R], \f[CR]dotnet test\f[R] 316 | T} 317 | _ 318 | .TE 319 | .PP 320 | .TS 321 | tab(@); 322 | lw(8.8n) lw(9.3n) lw(22.8n) lw(29.0n). 323 | T{ 324 | nix (flake) 325 | T}@T{ 326 | nix 327 | T}@T{ 328 | \f[CR]flake.nix\f[R] 329 | T}@T{ 330 | \f[CR]nix build\f[R], \f[CR]nix run\f[R], \f[CR]nix flake check\f[R] 331 | T} 332 | _ 333 | .TE 334 | .PP 335 | .TS 336 | tab(@); 337 | lw(8.8n) lw(9.3n) lw(22.8n) lw(29.0n). 338 | T{ 339 | nix (non\-flake) 340 | T}@T{ 341 | nix 342 | T}@T{ 343 | \f[CR]default.nix\f[R] 344 | T}@T{ 345 | \f[CR]nix\-build\f[R] 346 | T} 347 | _ 348 | .TE 349 | .PP 350 | .TS 351 | tab(@); 352 | lw(8.8n) lw(9.3n) lw(22.8n) lw(29.0n). 353 | T{ 354 | npm 355 | T}@T{ 356 | JavaScript, etc. 357 | T}@T{ 358 | \f[CR]package.json\f[R] 359 | T}@T{ 360 | \f[CR]npm build\f[R], \f[CR]npm start\f[R], \f[CR]npm test\f[R] 361 | T} 362 | _ 363 | .TE 364 | .PP 365 | .TS 366 | tab(@); 367 | lw(8.8n) lw(9.3n) lw(22.8n) lw(29.0n). 368 | T{ 369 | pnpm 370 | T}@T{ 371 | JavaScript, etc 372 | T}@T{ 373 | \f[CR]package.json\f[R] and \f[CR]pnpm\-lock.yaml\f[R] 374 | T}@T{ 375 | \f[CR]pnpm build\f[R], \f[CR]pnpm start\f[R], \f[CR]pnpm test\f[R] 376 | T} 377 | _ 378 | .TE 379 | .PP 380 | .TS 381 | tab(@); 382 | lw(8.8n) lw(9.3n) lw(22.8n) lw(29.0n). 383 | T{ 384 | Poetry 385 | T}@T{ 386 | Python 387 | T}@T{ 388 | \f[CR]pyproject.toml\f[R] with \f[CR][tool.poetry]\f[R] 389 | T}@T{ 390 | \f[CR]poetry build\f[R], run n/a, \f[CR]poetry run pytest\f[R] 391 | T} 392 | _ 393 | .TE 394 | .PP 395 | .TS 396 | tab(@); 397 | lw(8.8n) lw(9.3n) lw(22.8n) lw(29.0n). 398 | T{ 399 | Shell script 400 | T}@T{ 401 | Any 402 | T}@T{ 403 | \f[CR]build.sh\f[R] 404 | T}@T{ 405 | \f[CR]sh \-c build.sh\f[R] 406 | T} 407 | _ 408 | .TE 409 | .PP 410 | .TS 411 | tab(@); 412 | lw(8.8n) lw(9.3n) lw(22.8n) lw(29.0n). 413 | T{ 414 | Stack 415 | T}@T{ 416 | Haskell 417 | T}@T{ 418 | \f[CR]stack.yaml\f[R] 419 | T}@T{ 420 | \f[CR]stack build\f[R], \f[CR]stack run\f[R], \f[CR]stack test\f[R] 421 | T} 422 | _ 423 | .TE 424 | .PP 425 | .TS 426 | tab(@); 427 | lw(8.8n) lw(9.3n) lw(22.8n) lw(29.0n). 428 | T{ 429 | Tectonic 430 | T}@T{ 431 | LaTeX 432 | T}@T{ 433 | \f[CR]Tectonic.toml\f[R] 434 | T}@T{ 435 | \f[CR]tectonic \-X build\f[R] 436 | T} 437 | _ 438 | .TE 439 | .PP 440 | .TS 441 | tab(@); 442 | lw(8.8n) lw(9.3n) lw(22.8n) lw(29.0n). 443 | T{ 444 | yarn 445 | T}@T{ 446 | JavaScript, etc. 447 | T}@T{ 448 | \f[CR]package.json\f[R] and \f[CR]yarn.lock\f[R] 449 | T}@T{ 450 | \f[CR]yarn build\f[R], \f[CR]yarn start\f[R], \f[CR]yarn test\f[R] 451 | T} 452 | _ 453 | .TE 454 | .SH REPORTING BUGS 455 | Report any bugs you might find here: \c 456 | .UR https://github.com/paldepind/projectdo/issues 457 | .UE \c 458 | -------------------------------------------------------------------------------- /man/projectdo.1.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: projectdo 3 | section: 1 4 | header: User Manual 5 | footer: projectdo 1.0.1 6 | date: September 14, 2025 7 | --- 8 | 9 | # NAME 10 | 11 | projectdo - build, run, test, and more with ease 12 | 13 | # SYNOPSIS 14 | 15 | **projectdo** [*OPTION*] [*ACTION*] ... 16 | 17 | # DESCRIPTION 18 | 19 | projectdo is a command-line program that executes project actions (such as 20 | build, run, test, etc.) with the appropriate tool for current project in the 21 | working directory. The appropriate tool and the current project root is 22 | intelligently detected based on the context where projectdo is executed. For 23 | instance, projectdo test runs cargo test if a Cargo.toml is found and npm test 24 | if a package.json file is found. 25 | 26 | # OPTIONS 27 | 28 | **-h, `--`help** 29 | : display help message 30 | 31 | **-n, -d, `--`dry-run** 32 | : do not execute any commands with side-effects 33 | 34 | **-q, `--`quiet** 35 | : do not print commands as they are about to be executed 36 | 37 | **-v, `--`version** 38 | : prints installed projectdo version. 39 | 40 | # ACTIONS 41 | 42 | **build** 43 | : build project in working directory 44 | 45 | **run** 46 | : run the project in working directory 47 | 48 | **test** 49 | : test the project in working directory 50 | 51 | **tool** 52 | : Invoke the guessed tool for the current project 53 | 54 | # TOOL ARGUMENTS 55 | 56 | Any arguments following [action] are passed along to the invoked tool. 57 | 58 | # SHELL INTEGRATION 59 | 60 | ## FISH 61 | 62 | projectdo ships with a plugin for the Fish shell. The plugin includes 63 | auto-completion and functions for use with Fish's abbreviation feature. 64 | 65 | The Fish plugin can be installed manually or with Fisher (fish plugin manager): 66 | `fisher install paldepind/projectdo` 67 | 68 | The plugin exposes four shell functions that should be configured with 69 | abbreviations as desired. For instance: 70 | 71 | ``` 72 | abbr -a b --function projectdo_build 73 | abbr -a r --function projectdo_run 74 | abbr -a t --function projectdo_test 75 | abbr -a p --function projectdo_tool 76 | ``` 77 | 78 | With the above `t` will expand to `cargo test`, `p` will expand to `cargo`, etc. 79 | depending on the project. 80 | 81 | ## BASH + OTHERS 82 | 83 | projectdo can be configured with shell aliases in any shell. For instance: 84 | 85 | ``` 86 | alias t='projectdo test' 87 | alias r='projectdo run' 88 | alias b='projectdo build' 89 | alias p='projectdo tool' 90 | ``` 91 | 92 | # SUPPORTED TOOLS AND LANGUAGES 93 | 94 | | Tool | Language | Detected by | Commands | 95 | |-----------------|------------------|--------------------------------------------|--------------------------------------------------------| 96 | 97 | | bun | JavaScript, etc | `package.json` and `bun.lock`/`bun.lockb` | `bun build`, `bun start`, `bun test` | 98 | |-----------------|------------------|--------------------------------------------|--------------------------------------------------------| 99 | 100 | | Cabal | Haskell | `*.cabal` | `cabal build`, `cabal run`, `cabal test` | 101 | |-----------------|------------------|--------------------------------------------|--------------------------------------------------------| 102 | 103 | | Cargo | Rust | `Cargo.toml` | `cargo build`, `cargo run`, `cargo test` | 104 | |-----------------|------------------|--------------------------------------------|--------------------------------------------------------| 105 | 106 | | CMake | C, C++ and Obj-C | `CMakeLists.txt` | `cmake --build . --target test` | 107 | |-----------------|------------------|--------------------------------------------|--------------------------------------------------------| 108 | 109 | | Dune | OCaml | `dune-project` | `dune build`, `dune exec`, `dune runtest` | 110 | |-----------------|------------------|--------------------------------------------|--------------------------------------------------------| 111 | 112 | | Go | Go | `go.mod` | `go test` | 113 | |-----------------|------------------|--------------------------------------------|--------------------------------------------------------| 114 | 115 | | Gradle | Java, etc. | `build.gradle` or `build.gradle.kts` | `gradle compile`, `gradle run`, `gradle test` | 116 | |-----------------|------------------|--------------------------------------------|--------------------------------------------------------| 117 | 118 | | just | Any | `justfile` | `just build`, `just run`, `just test` | 119 | |-----------------|------------------|--------------------------------------------|--------------------------------------------------------| 120 | 121 | | Lake | Lean | `lakefile.lean` or `lakefile.toml` | `lake build`, `lake run`, `lake test` | 122 | |-----------------|------------------|--------------------------------------------|--------------------------------------------------------| 123 | 124 | | Leiningen | Clojure | `project.clj` | `lein test` | 125 | |-----------------|------------------|--------------------------------------------|--------------------------------------------------------| 126 | 127 | | Mage | Go | `magefile.go` with a `test`/`check` target | `mage test/check` | 128 | |-----------------|------------------|--------------------------------------------|--------------------------------------------------------| 129 | 130 | | make | Any | `Makefile` | `make`, `make test/check` | 131 | |-----------------|------------------|--------------------------------------------|--------------------------------------------------------| 132 | 133 | | Maven | Java, etc. | `pom.xml` | `mvn compile`, run n/a, `mvn test` | 134 | |-----------------|------------------|--------------------------------------------|--------------------------------------------------------| 135 | 136 | | Meson | C, C++, etc. | `meson.build` | `meson compile`, run n/a, `meson test` | 137 | |-----------------|------------------|--------------------------------------------|--------------------------------------------------------| 138 | 139 | | .NET | C# and F# | `*.csproj`, `*.fsproj` or `*.sln` | `dotnet build`, `dotnet run`, `dotnet test` | 140 | |-----------------|------------------|--------------------------------------------|--------------------------------------------------------| 141 | 142 | | nix (flake) | nix | `flake.nix` | `nix build`, `nix run`, `nix flake check` | 143 | |-----------------|------------------|--------------------------------------------|--------------------------------------------------------| 144 | 145 | | nix (non-flake) | nix | `default.nix` | `nix-build` | 146 | |-----------------|------------------|--------------------------------------------|--------------------------------------------------------| 147 | 148 | | npm | JavaScript, etc. | `package.json` | `npm build`, `npm start`, `npm test` | 149 | |-----------------|------------------|--------------------------------------------|--------------------------------------------------------| 150 | 151 | | pnpm | JavaScript, etc | `package.json` and `pnpm-lock.yaml` | `pnpm build`, `pnpm start`, `pnpm test` | 152 | |-----------------|------------------|--------------------------------------------|--------------------------------------------------------| 153 | 154 | | Poetry | Python | `pyproject.toml` with `[tool.poetry]` | `poetry build`, run n/a, `poetry run pytest` | 155 | |-----------------|------------------|--------------------------------------------|--------------------------------------------------------| 156 | 157 | | Shell script | Any | `build.sh` | `sh -c build.sh` | 158 | |-----------------|------------------|--------------------------------------------|--------------------------------------------------------| 159 | 160 | | Stack | Haskell | `stack.yaml` | `stack build`, `stack run`, `stack test` | 161 | |-----------------|------------------|--------------------------------------------|--------------------------------------------------------| 162 | 163 | | Tectonic | LaTeX | `Tectonic.toml` | `tectonic -X build` | 164 | |-----------------|------------------|--------------------------------------------|--------------------------------------------------------| 165 | 166 | | yarn | JavaScript, etc. | `package.json` and `yarn.lock` | `yarn build`, `yarn start`, `yarn test` | 167 | |-----------------|------------------|--------------------------------------------|--------------------------------------------------------| 168 | 169 | # REPORTING BUGS 170 | 171 | Report any bugs you might find here: 172 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "projectdo", 3 | "version": "1.0.1", 4 | "description": "Context-aware single-letter project commands to speed up your terminal workflow.", 5 | "bin": { 6 | "projectdo": "./projectdo" 7 | }, 8 | "files": [ 9 | "projectdo" 10 | ], 11 | "repository": { 12 | "type": "git", 13 | "url": "git+https://github.com/paldepind/projectdo.git" 14 | }, 15 | "keywords": [ 16 | "test", 17 | "build", 18 | "run", 19 | "cli", 20 | "project", 21 | "command" 22 | ], 23 | "author": "Simon Friis Vindum", 24 | "license": "GPL-3.0-or-later", 25 | "bugs": { 26 | "url": "https://github.com/paldepind/projectdo/issues" 27 | }, 28 | "homepage": "https://github.com/paldepind/projectdo#readme", 29 | "dependencies": { 30 | "projectdo": "^0.2.0" 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /projectdo: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # projectdo – universal project commands. 4 | # Copyright (C) 2019-present Simon Friis Vindum 5 | 6 | # This program is free software: you can redistribute it and/or modify 7 | # it under the terms of the GNU General Public License as published by 8 | # the Free Software Foundation, either version 3 of the License, or 9 | # (at your option) any later version. 10 | 11 | # This program is distributed in the hope that it will be useful, 12 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | # GNU General Public License for more details. 15 | 16 | # You should have received a copy of the GNU General Public License 17 | # along with this program. If not, see . 18 | 19 | VERSION="1.0.1" 20 | 21 | # Global mutable variables. 22 | QUIET=false 23 | DRY_RUN=false 24 | PROJECT_ROOT="${PROJECT_ROOT:-}" 25 | ACTION="" 26 | TOOL_ARGS="" # Arguments to pass along to the tool 27 | IS_TOOL=false # True if ACTION is 'tool' as this action is somewhat special. 28 | 29 | # Check if a command is available. 30 | has_command() { 31 | command -v "$1" >/dev/null 2>&1 32 | } 33 | 34 | # Check if a command is available, if not print an error message and exit. 35 | has_command_or_error() { 36 | # If this is a dry run, we don't check whether the command is available. 37 | if [ $DRY_RUN = false ] && ! has_command "$1"; then 38 | tool_name="$3" 39 | if [ -z "$tool_name" ]; then 40 | tool_name="$1" 41 | fi 42 | echo "Found a '$2' file but '$tool_name' is not installed." 43 | exit 1 44 | fi 45 | } 46 | 47 | # Output the global `ACTION` variable with a translation applied. A translation 48 | # has the form `action=translation`. The shortcut `action` is equivalent to 49 | # `action=action`. If no translation applies then a non-zero status code is 50 | # returned. The `tool` action is not subject to translations. 51 | translate_action() { 52 | if $IS_TOOL; then 53 | echo tool 54 | return 55 | fi 56 | for arg in "$@"; do 57 | case "$arg" in 58 | $ACTION) 59 | echo "$arg" 60 | return 0 61 | ;; 62 | ${ACTION}=*) 63 | # Pick out the part after the `=` 64 | echo "$arg" | sed "s/${ACTION}=\(.*\)/\1/" 65 | return 0 66 | ;; 67 | esac 68 | done 69 | echo "" 70 | return 1 71 | } 72 | 73 | # When running the appropriate external tool this function is used which 74 | # evaluates the given command while respecting $QUIET and $DRY_RUN. 75 | # shellcheck disable=SC2086 76 | execute() { 77 | if [ $QUIET = false ]; then 78 | echo "$1" $TOOL_ARGS 79 | fi 80 | if [ $DRY_RUN = false ]; then 81 | if [ $QUIET = false ]; then 82 | eval "$1" $TOOL_ARGS 83 | else 84 | eval "$1" $TOOL_ARGS >/dev/null 85 | fi 86 | fi 87 | } 88 | 89 | # Takes the name of a tool and an optional action. If the action is `tool` it is 90 | # ignored. It handles the common case where the tool is invoked as `tool 91 | # action`. 92 | execute_command() { 93 | if [ "$2" = tool ] || [ -z "$2" ]; then 94 | execute "$1" 95 | else 96 | execute "$1 $2" 97 | fi 98 | exit 0 99 | } 100 | 101 | # Navigate up one directory. The command is successful if this is possible 102 | # without leaving the current project, entering the home directory, or entering 103 | # the root directory. 104 | go_up() { 105 | if [ "$PWD" = "$PROJECT_ROOT" ]; then 106 | return 1 107 | fi 108 | cd .. 109 | if [ "$PWD" = "$HOME" ] || [ "$PWD" = / ]; then 110 | return 1 111 | fi 112 | return 0 113 | } 114 | 115 | # Every supported tool requires a function `try_tool` where `tool` is a name 116 | # indicating what tool the function tries to detect. The function should: 117 | # 118 | # * Return if it does not detect that the tool is appropriate. 119 | # * Read the variables `ACTION` and `IS_TOOL` to determine the correct action 120 | # to run. 121 | # * When running an action is should use the `execute` function and _exit_ when 122 | # it is done. 123 | 124 | # Start list of tools 125 | 126 | # JavaScript + NodeJS 127 | 128 | # After a `package.json` has been found this detects the tool to use based on 129 | # any present lock file. In monorepo setups the lockfile might be in a parent 130 | # directory and not right next to the `package.json` file. This is handled by 131 | # looking up the directory hierarchy. 132 | detect_nodejs_tool() { 133 | while :; do 134 | if [ -f package-lock.json ]; then 135 | echo yarn 136 | return 137 | elif [ -f bun.lock ] || [ -f bun.lockb ]; then 138 | echo bun 139 | return 140 | elif [ -f yarn.lock ]; then 141 | echo yarn 142 | return 143 | elif [ -f pnpm-lock.yaml ]; then 144 | echo pnpm 145 | return 146 | fi 147 | if ! go_up; then 148 | echo npm 149 | return 150 | fi 151 | done 152 | } 153 | 154 | try_nodejs() { 155 | if [ ! -f package.json ]; then 156 | return 1 157 | fi 158 | tool=$(detect_nodejs_tool) 159 | has_command_or_error "$tool" package.json 160 | node_action=$(translate_action build run=start test) 161 | # We check if the package.json file contains an appropriate script. We use 162 | # grep for this. The check is not 100% bulletproof, but it's very close. We 163 | # could've used `npm run` to get the authorative list of the scripts but 164 | # invoking `npm` is two orders of magnitude slower which leads to a 165 | # noticeable delay. 166 | if ! $IS_TOOL && ! grep -q "^[[:space:]]*\"${node_action}\":" package.json; then 167 | return 0 168 | fi 169 | if [ "$ACTION" = build ]; then 170 | execute_command "$tool" "run build" 171 | else 172 | execute_command "$tool" "$node_action" 173 | fi 174 | } 175 | 176 | # Rust + Cargo 177 | 178 | try_cargo() { 179 | if [ -f Cargo.toml ]; then 180 | has_command_or_error cargo Cargo.toml 181 | execute_command cargo "$ACTION" 182 | fi 183 | } 184 | 185 | # Meson 186 | 187 | try_meson() { 188 | if [ -f meson.build ]; then 189 | has_command_or_error meson meson.build 190 | action=$(translate_action test build=compile) 191 | if [ $? -eq 0 ]; then 192 | execute_command meson "$action" 193 | fi 194 | fi 195 | } 196 | 197 | # CMake 198 | 199 | try_cmake() { 200 | if [ -f CMakeLists.txt ]; then 201 | case $ACTION in 202 | test) 203 | if [ -f build ]; then 204 | execute_command cmake "--build build --target test" 205 | else 206 | execute_command cmake "--build . --target test" 207 | fi 208 | ;; 209 | tool) execute_command cmake tool ;; 210 | esac 211 | fi 212 | } 213 | 214 | # Haskell + Stack 215 | 216 | try_stack() { 217 | if [ -f package.yaml ] && [ -f stack.yaml ]; then 218 | has_command_or_error stack package.yaml 219 | execute_command stack "$ACTION" 220 | fi 221 | } 222 | 223 | # Haskell + Cabal 224 | 225 | try_cabal() { 226 | cabal_file="$(find ./ -maxdepth 1 -name "*.cabal" 2>/dev/null | wc -l)" 227 | if [ "$cabal_file" -gt 0 ] && [ ! -f stack.yml ]; then 228 | has_command_or_error cabal cabal 229 | execute_command cabal "$ACTION" 230 | fi 231 | } 232 | 233 | # Maven 234 | 235 | try_maven() { 236 | if [ -f pom.xml ]; then 237 | action=$(translate_action test build=compile) 238 | if [ $? -eq 0 ]; then 239 | has_command_or_error mvn pom.xml maven 240 | execute_command mvn "$action" 241 | fi 242 | fi 243 | } 244 | 245 | # Gradle 246 | 247 | try_gradle() { 248 | if [ -f build.gradle ] || [ -f build.gradle.kts ]; then 249 | has_command_or_error gradle build.gradle 250 | execute_command gradle "$ACTION" 251 | fi 252 | } 253 | 254 | # Clojure + Leiningen 255 | 256 | try_lein() { 257 | if [ -f project.clj ]; then 258 | if [ "$ACTION" = build ]; then 259 | echo "projectdo does not know how to build a project with Leiningen." 260 | exit 261 | fi 262 | has_command_or_error lein project.clj 263 | execute_command lein "$ACTION" 264 | fi 265 | } 266 | 267 | # justfile 268 | 269 | try_justfile() { 270 | if [ -f justfile ]; then 271 | has_command_or_error just justfile 272 | execute_command just "$ACTION" 273 | fi 274 | } 275 | 276 | # Makefile 277 | 278 | has_make_target() { 279 | target="${1?}" 280 | output=$(make -n "${target}" 2>&1) 281 | exit_code=$? 282 | if [ $exit_code -ne 0 ]; then 283 | return $exit_code 284 | fi 285 | 286 | # If there is a file with the name of the target we're looking for but no 287 | # actual target with that name, make will exit successfully with that 288 | # message. We need to consider that case as a "target not found". Note that 289 | # the way the target is quoted in the output (`test' vs 'test') can differ 290 | # across OSes so we only check a prefix up to the problematic quotes. 291 | if expr "$output" : "make: Nothing to be done for" 1>/dev/null; then 292 | return 1 293 | fi 294 | 295 | return 0 296 | } 297 | 298 | try_makefile() { 299 | if [ -f Makefile ]; then 300 | has_command_or_error make Makefile 301 | if $IS_TOOL || [ "$ACTION" = build ]; then 302 | # For make "build" is the default action when running `make` 303 | execute_command "make" 304 | elif [ "$ACTION" = test ]; then 305 | # Let's see if the makefile contains a test or check target 306 | if has_make_target "test"; then 307 | execute_command make test 308 | elif has_make_target "check"; then 309 | execute_command make check 310 | fi 311 | fi 312 | fi 313 | return 1 314 | } 315 | 316 | # Nix (Flake) 317 | 318 | try_nix_flake() { 319 | if [ -f flake.nix ]; then 320 | has_command_or_error nix flake.nix 321 | action=$(translate_action "test=flake check" build run) 322 | execute_command nix "$action" 323 | fi 324 | return 1 325 | } 326 | 327 | # Nix (package) 328 | 329 | try_nix_package() { 330 | if [ -f default.nix ]; then 331 | has_command_or_error nix-build default.nix 332 | action=$(translate_action build=) 333 | execute_command nix-build "$action" 334 | fi 335 | return 1 336 | } 337 | 338 | # Python 339 | 340 | try_python() { 341 | if [ -f pyproject.toml ]; then 342 | if grep -q -m 1 "^\[tool.poetry\]$" pyproject.toml; then 343 | action=$(translate_action build "test=run pytest") 344 | if [ $? -eq 0 ]; then 345 | execute_command poetry "$action" 346 | fi 347 | else 348 | if [ -f uv.lock ]; then 349 | case $ACTION in 350 | build | test) 351 | echo "projectdo does not know how to $ACTION a project with uv." 352 | exit 353 | ;; 354 | run | tool) execute_command uv "$ACTION" ;; 355 | esac 356 | else 357 | echo "Found a pyproject.toml file but projectdo is not sure how to run it." 358 | exit 359 | fi 360 | fi 361 | return 1 362 | fi 363 | } 364 | 365 | # Go 366 | 367 | try_go() { 368 | # We detect Makefiles before we detect Go, so here we know that the Go project 369 | # is not tested by a Makefile. 370 | if [ -f go.mod ]; then 371 | 372 | # Check if the project uses Mage. A magefile could in theory have any name, 373 | # but `magefile.go` seems to be the convention. 374 | if [ "$ACTION" = test ] && [ -f magefile.go ]; then 375 | 376 | if grep -q -m 1 '^func Check(' magefile.go; then 377 | execute_command mage check 378 | elif grep -q -m 1 '^func Test(' magefile.go; then 379 | execute_command mage test 380 | fi 381 | fi 382 | execute_command go "$ACTION" 383 | fi 384 | } 385 | 386 | # LaTeX 387 | 388 | try_latex() { 389 | if [ -f Tectonic.toml ]; then 390 | case $ACTION in 391 | build) execute_command tectonic "-X build" ;; 392 | tool) execute_command tectonic ;; 393 | esac 394 | fi 395 | } 396 | 397 | # .NET 398 | 399 | try_dotnet() { 400 | if [ -n "$(find . -maxdepth 1 \( -name '*.csproj' -o -name '*.fsproj' -o -name '*.sln' \) -print -quit)" ]; then 401 | execute_command dotnet "$ACTION" 402 | fi 403 | } 404 | 405 | # OCaml + Dune 406 | 407 | try_dune() { 408 | if [ -f dune-project ]; then 409 | case $ACTION in 410 | test) 411 | execute_command dune runtest 412 | ;; 413 | run) 414 | execute_command dune exec 415 | ;; 416 | build | tool) 417 | execute_command dune "$ACTION" 418 | ;; 419 | esac 420 | fi 421 | } 422 | 423 | # Lean + Lake 424 | 425 | try_lake() { 426 | if [ -f lakefile.lean ] || [ -f lakefile.toml ]; then 427 | has_command_or_error lake lakefile.lean 428 | execute_command lake "$ACTION" 429 | fi 430 | } 431 | 432 | # Any / Generic 433 | 434 | try_build_script() { 435 | if [ "$ACTION" = build ]; then 436 | if [ -f ./build.sh ]; then 437 | execute "sh -c build.sh" 438 | exit 439 | fi 440 | fi 441 | } 442 | 443 | # End of list of tools 444 | 445 | detect_and_run() { 446 | try_justfile 447 | try_makefile 448 | try_nodejs 449 | try_cargo 450 | try_stack 451 | try_cabal 452 | try_meson 453 | try_cmake 454 | try_maven 455 | try_gradle 456 | try_lein 457 | try_nix_flake 458 | try_nix_package 459 | try_python 460 | try_go 461 | try_latex 462 | try_dotnet 463 | try_dune 464 | try_lake 465 | try_build_script 466 | } 467 | 468 | set_project_root() { 469 | if [ -n "$PROJECT_ROOT" ]; then 470 | return 471 | fi 472 | 473 | if has_command git; then 474 | # Find the root of the git repository if we're inside one. If we're in a 475 | # git submodule then the root of the outer git repo is used. If we're not 476 | # in a git repo the git command will not output anything and $PROJECT_ROOT 477 | # is set to the empty string which is fine. 478 | PROJECT_ROOT=$(git rev-parse --show-superproject-working-tree --show-toplevel 2>/dev/null | head -n 1) 479 | fi 480 | } 481 | 482 | nothing_found() { 483 | echo "No way to $ACTION found :'(" 484 | exit 1 485 | } 486 | 487 | display_version() { 488 | echo "$(basename "$0") version $VERSION" 489 | } 490 | 491 | display_help() { 492 | echo "Usage: $(basename "$0") [options] [action] [tool-arguments] 493 | Options: 494 | -h, --help Display this help. 495 | -n, -d, --dry-run Do not execute any commands with side-effects. 496 | -q, --quiet Do not print commands as they are about to be executed. 497 | -v, --version Display the version of the program (which is $VERSION). 498 | 499 | Actions: 500 | build, run, test Build, run, or test the current project. 501 | tool Invoke the guessed tool for the current project. 502 | 503 | Tool arguments: 504 | Any arguments following [action] are passed along to the invoked tool." 505 | } 506 | 507 | # Main execution starts here 508 | 509 | while getopts dhnqv-: c; do 510 | case $c in 511 | d) DRY_RUN=true ;; 512 | h) 513 | display_help 514 | exit 0 515 | ;; 516 | n) DRY_RUN=true ;; 517 | q) QUIET=true ;; 518 | v) 519 | display_version 520 | exit 0 521 | ;; 522 | -) case $OPTARG in 523 | help) 524 | display_help 525 | exit 0 526 | ;; 527 | dry-run) DRY_RUN=true ;; 528 | quiet) QUIET=true ;; 529 | version) 530 | display_version 531 | exit 0 532 | ;; 533 | '') break ;; # "--" should terminate argument processing 534 | *) 535 | echo "Illegal option --$OPTARG" >&2 536 | exit 1 537 | ;; 538 | esac ;; 539 | \?) exit 1 ;; 540 | esac 541 | done 542 | 543 | shift $((OPTIND - 1)) # Shift away the parsed option arguments 544 | 545 | if [ "$1" = test ] || 546 | [ "$1" = run ] || 547 | [ "$1" = build ] || 548 | [ "$1" = tool ]; then 549 | ACTION=$1 550 | if [ "$1" = tool ]; then 551 | IS_TOOL=true 552 | fi 553 | shift 1 # Remove the action from the arguments 554 | # shellcheck disable=SC2124 555 | TOOL_ARGS=$@ 556 | else 557 | if [ -z "$1" ]; then 558 | echo "No action specified." 559 | else 560 | echo "$1 is not a valid action." 561 | fi 562 | echo "" 563 | echo "The valid actions are: build, run, test, tool" 564 | echo "" 565 | echo "Example: projectdo test" 566 | exit 1 567 | fi 568 | 569 | set_project_root 570 | 571 | while :; do 572 | detect_and_run 573 | # If we didn't detect a tool to run in this directory we go up one directory 574 | if ! go_up; then 575 | nothing_found 576 | fi 577 | done 578 | -------------------------------------------------------------------------------- /run-tests.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # Colors 4 | RED=$(tput setaf 1) 5 | BOLD=$(tput bold) 6 | RESET=$(tput sgr0) 7 | 8 | ANY_ERRORS=false 9 | 10 | # Make sets this variable when we run it and can influence the test results. 11 | # Since this script is run through `make`, we need to unset it. 12 | unset MAKELEVEL 13 | 14 | # Get the directory of the current script, in a POSIX compatible way 15 | # https://stackoverflow.com/a/29835459 16 | script_directory=$(CDPATH="$(cd -- "$(dirname -- "$0")")" && pwd -P) 17 | 18 | # Set this variable to ensure top level Makefile doesn't affect the results. 19 | export PROJECT_ROOT="${script_directory}/tests" 20 | 21 | describe() { 22 | printf "\n%s%s%s" "$BOLD" "$1" "$RESET" 23 | } 24 | 25 | it() { 26 | printf "\n %s" "$1" 27 | } 28 | 29 | assert() { 30 | if [ $RUN_EXIT -eq 0 ]; then 31 | printf " ✓" 32 | else 33 | printf "\n Fail\n" 34 | ANY_ERRORS=true 35 | fi 36 | } 37 | 38 | assertFails() { 39 | if [ $RUN_EXIT -ne 0 ]; then 40 | printf " ✓" 41 | else 42 | printf "\n Fail\n" 43 | ANY_ERRORS=true 44 | fi 45 | } 46 | 47 | assertEqual() { 48 | if [ "$1" = "$2" ]; then 49 | printf " ✓" 50 | else 51 | printf "\n %s%s Error:%s Expected \"%s\" to equal \"%s\"\n" "$BOLD" "$RED" "$RESET" "$1" "$2" 52 | ANY_ERRORS=true 53 | fi 54 | } 55 | RUN_EXIT=0 56 | 57 | do_build_in() { 58 | RUN_RESULT=$(cd tests/"$1" && "$script_directory"/projectdo -n build) 59 | RUN_EXIT=$? 60 | } 61 | 62 | do_run_in() { 63 | RUN_RESULT=$(cd tests/"$1" && "$script_directory"/projectdo -n run) 64 | RUN_EXIT=$? 65 | } 66 | 67 | do_test_in() { 68 | RUN_RESULT=$(cd tests/"$1" && "$script_directory"/projectdo -n test) 69 | RUN_EXIT=$? 70 | } 71 | 72 | do_print_tool_in() { 73 | RUN_RESULT=$(cd tests/"$1" && "$script_directory"/projectdo -n tool) 74 | RUN_EXIT=$? 75 | } 76 | 77 | if describe "cargo"; then 78 | if it "can run build"; then 79 | do_build_in "cargo" 80 | assert 81 | assertEqual "$RUN_RESULT" "cargo build" 82 | fi 83 | if it "can run run"; then 84 | do_run_in "cargo" 85 | assert 86 | assertEqual "$RUN_RESULT" "cargo run" 87 | fi 88 | if it "can run test"; then 89 | do_test_in "cargo" 90 | assert 91 | assertEqual "$RUN_RESULT" "cargo test" 92 | fi 93 | if it "can print tool"; then 94 | do_print_tool_in "cargo" 95 | assert 96 | assertEqual "$RUN_RESULT" "cargo" 97 | fi 98 | if it "passes additional arguments to the tool"; then 99 | RUN_RESULT=$(cd tests/cargo && ../../projectdo -n build --release) 100 | assertEqual "$RUN_RESULT" "cargo build --release" 101 | fi 102 | fi 103 | 104 | if describe "stack"; then 105 | if it "can run build"; then 106 | do_build_in "stack" 107 | assert 108 | assertEqual "$RUN_RESULT" "stack build" 109 | fi 110 | if it "can run run"; then 111 | do_run_in "stack" 112 | assert 113 | assertEqual "$RUN_RESULT" "stack run" 114 | fi 115 | if it "can run test"; then 116 | do_test_in "stack" 117 | assert 118 | assertEqual "$RUN_RESULT" "stack test" 119 | fi 120 | if it "can print tool"; then 121 | do_print_tool_in "stack" 122 | assert 123 | assertEqual "$RUN_RESULT" "stack" 124 | fi 125 | fi 126 | 127 | if describe "npm / yarn / pnpm / bun"; then 128 | if it "can run npm build if package.json with build script"; then 129 | do_build_in "npm" 130 | assert 131 | assertEqual "$RUN_RESULT" "npm run build" 132 | fi 133 | if it "can run npm start if package.json with start script"; then 134 | do_run_in "npm" 135 | assert 136 | assertEqual "$RUN_RESULT" "npm start" 137 | fi 138 | if it "can run npm test if package.json with test script"; then 139 | do_test_in "npm" 140 | assert 141 | assertEqual "$RUN_RESULT" "npm test" 142 | fi 143 | if it "uses yarn if yarn.lock is present"; then 144 | do_test_in "yarn" 145 | assert 146 | assertEqual "$RUN_RESULT" "yarn test" 147 | fi 148 | if it "uses pnpm if pnpm-lock.yaml is present"; then 149 | do_test_in "pnpm" 150 | assert 151 | assertEqual "$RUN_RESULT" "pnpm test" 152 | fi 153 | if it "uses bun if bun.lock is present"; then 154 | do_test_in "bun" 155 | assert 156 | assertEqual "$RUN_RESULT" "bun test" 157 | fi 158 | if it "uses bun if bun.lockb is present"; then 159 | do_test_in "bun-lockb" 160 | assert 161 | assertEqual "$RUN_RESULT" "bun test" 162 | fi 163 | if it "can run bun build if package.json with build script"; then 164 | do_build_in "bun" 165 | assert 166 | assertEqual "$RUN_RESULT" "bun run build" 167 | fi 168 | if it "can run bun start if package.json with start script"; then 169 | do_run_in "bun" 170 | assert 171 | assertEqual "$RUN_RESULT" "bun start" 172 | fi 173 | if it "can run bun test if package.json with test script"; then 174 | do_test_in "bun" 175 | assert 176 | assertEqual "$RUN_RESULT" "bun test" 177 | fi 178 | if it "can run pnpm build if package.json with build script"; then 179 | do_build_in "pnpm" 180 | assert 181 | assertEqual "$RUN_RESULT" "pnpm run build" 182 | fi 183 | if it "can run pnpm start if package.json with start script"; then 184 | do_run_in "pnpm" 185 | assert 186 | assertEqual "$RUN_RESULT" "pnpm start" 187 | fi 188 | if it "can run pnpm test if package.json with test script"; then 189 | do_test_in "pnpm" 190 | assert 191 | assertEqual "$RUN_RESULT" "pnpm test" 192 | fi 193 | if it "does not use npm if package.json contains no test script"; then 194 | do_test_in "npm-without-test" 195 | assert 196 | assertEqual "$RUN_RESULT" "make test" 197 | fi 198 | if it "can print tool"; then 199 | do_print_tool_in "npm" 200 | assert 201 | assertEqual "$RUN_RESULT" "npm" 202 | do_print_tool_in "yarn" 203 | assert 204 | assertEqual "$RUN_RESULT" "yarn" 205 | do_print_tool_in "pnpm" 206 | assert 207 | assertEqual "$RUN_RESULT" "pnpm" 208 | do_print_tool_in "bun" 209 | assert 210 | assertEqual "$RUN_RESULT" "bun" 211 | fi 212 | if it "detects yarn in workspace setup"; then 213 | do_print_tool_in "yarn-workspace/workspace-a" 214 | assert 215 | assertEqual "$RUN_RESULT" "yarn" 216 | do_print_tool_in "yarn-workspace/workspace-b" 217 | assert 218 | assertEqual "$RUN_RESULT" "yarn" 219 | fi 220 | fi 221 | 222 | if describe "just"; then 223 | if it "finds test target"; then 224 | do_test_in "just" 225 | assert 226 | assertEqual "$RUN_RESULT" "just test" 227 | fi 228 | if it "finds build target"; then 229 | do_build_in "just" 230 | assert 231 | assertEqual "$RUN_RESULT" "just build" 232 | fi 233 | if it "finds run target"; then 234 | do_run_in "just" 235 | assert 236 | assertEqual "$RUN_RESULT" "just run" 237 | fi 238 | if it "can print tool"; then 239 | do_print_tool_in "just" 240 | assert 241 | assertEqual "$RUN_RESULT" "just" 242 | fi 243 | fi 244 | 245 | if describe "make"; then 246 | if it "finds check target"; then 247 | do_test_in "make-check" 248 | assert 249 | assertEqual "$RUN_RESULT" "make check" 250 | fi 251 | if it "ignores file named check"; then 252 | do_test_in "make-check-with-check-file" 253 | assertFails 254 | assertEqual "$RUN_RESULT" "No way to test found :'(" 255 | fi 256 | if it "finds check target if both target and file named check"; then 257 | do_test_in "make-check-with-check-file-and-target" 258 | assert 259 | assertEqual "$RUN_RESULT" "make check" 260 | fi 261 | if it "finds check target despite package.json"; then 262 | do_test_in "make-with-npm" 263 | assert 264 | assertEqual "$RUN_RESULT" "make check" 265 | fi 266 | fi 267 | 268 | if describe "nix-flake"; then 269 | if it "can build with nix"; then 270 | do_build_in "nix-flake" 271 | assert 272 | assertEqual "$RUN_RESULT" "nix build" 273 | fi 274 | if it "can run with nix"; then 275 | do_run_in "nix-flake" 276 | assert 277 | assertEqual "$RUN_RESULT" "nix run" 278 | fi 279 | if it "can test with nix"; then 280 | do_test_in "nix-flake" 281 | assert 282 | assertEqual "$RUN_RESULT" "nix flake check" 283 | fi 284 | if it "can print tool"; then 285 | do_print_tool_in "nix-flake" 286 | assert 287 | assertEqual "$RUN_RESULT" "nix" 288 | fi 289 | fi 290 | 291 | if describe "nix"; then 292 | if it "can build with nix-build"; then 293 | do_build_in "nix" 294 | assert 295 | assertEqual "$RUN_RESULT" "nix-build" 296 | fi 297 | if it "can print tool"; then 298 | do_print_tool_in "nix" 299 | assert 300 | assertEqual "$RUN_RESULT" "nix-build" 301 | fi 302 | fi 303 | 304 | if describe "go"; then 305 | if it "finds check target in magefile"; then 306 | do_test_in "mage" 307 | assert 308 | assertEqual "$RUN_RESULT" "mage check" 309 | fi 310 | if it "runs go test without magefile"; then 311 | do_test_in "go" 312 | assert 313 | assertEqual "$RUN_RESULT" "go test" 314 | fi 315 | if it "can run go run"; then 316 | do_run_in "go" 317 | assert 318 | assertEqual "$RUN_RESULT" "go run" 319 | fi 320 | if it "can run go build"; then 321 | do_build_in "go" 322 | assert 323 | assertEqual "$RUN_RESULT" "go build" 324 | fi 325 | if it "can print tool"; then 326 | do_print_tool_in "go" 327 | assert 328 | assertEqual "$RUN_RESULT" "go" 329 | fi 330 | fi 331 | 332 | if describe "python"; then 333 | if it "can build with poetry"; then 334 | do_build_in "poetry" 335 | assert 336 | assertEqual "$RUN_RESULT" "poetry build" 337 | fi 338 | if it "runs pytest with poetry"; then 339 | do_test_in "poetry" 340 | assert 341 | assertEqual "$RUN_RESULT" "poetry run pytest" 342 | fi 343 | if it "can print tool with poetry"; then 344 | do_print_tool_in "poetry" 345 | assert 346 | assertEqual "$RUN_RESULT" "poetry" 347 | fi 348 | if it "can run with uv"; then 349 | do_run_in "uv" 350 | assert 351 | assertEqual "$RUN_RESULT" "uv run" 352 | fi 353 | if it "can print tool with uv"; then 354 | do_print_tool_in "uv" 355 | assert 356 | assertEqual "$RUN_RESULT" "uv" 357 | fi 358 | fi 359 | 360 | if describe "latex"; then 361 | if it "can build with tectonic"; then 362 | do_build_in "tectonic" 363 | assert 364 | assertEqual "$RUN_RESULT" "tectonic -X build" 365 | fi 366 | if it "can print tool"; then 367 | do_print_tool_in "tectonic" 368 | assert 369 | assertEqual "$RUN_RESULT" "tectonic" 370 | fi 371 | fi 372 | 373 | if describe "meson"; then 374 | if it "can build with meson"; then 375 | do_build_in "meson" 376 | assert 377 | assertEqual "$RUN_RESULT" "meson compile" 378 | fi 379 | if it "can test with meson"; then 380 | do_test_in "meson" 381 | assert 382 | assertEqual "$RUN_RESULT" "meson test" 383 | fi 384 | if it "can print tool"; then 385 | do_print_tool_in "meson" 386 | assert 387 | assertEqual "$RUN_RESULT" "meson" 388 | fi 389 | fi 390 | 391 | if describe "gradle"; then 392 | if it "can build with gradle"; then 393 | do_build_in "gradle" 394 | assert 395 | assertEqual "$RUN_RESULT" "gradle build" 396 | fi 397 | if it "can run with gradle"; then 398 | do_run_in "gradle" 399 | assert 400 | assertEqual "$RUN_RESULT" "gradle run" 401 | fi 402 | if it "can test with gradle"; then 403 | do_test_in "gradle" 404 | assert 405 | assertEqual "$RUN_RESULT" "gradle test" 406 | fi 407 | if it "can print tool"; then 408 | do_print_tool_in "gradle" 409 | assert 410 | assertEqual "$RUN_RESULT" "gradle" 411 | fi 412 | fi 413 | 414 | if describe "cmake"; then 415 | if it "can test tool"; then 416 | do_test_in "cmake" 417 | assert 418 | assertEqual "$RUN_RESULT" "cmake --build . --target test" 419 | fi 420 | if it "can print tool"; then 421 | do_print_tool_in "cmake" 422 | assert 423 | assertEqual "$RUN_RESULT" "cmake" 424 | fi 425 | fi 426 | 427 | if describe "maven"; then 428 | if it "can print tool"; then 429 | do_print_tool_in "maven" 430 | assert 431 | assertEqual "$RUN_RESULT" "mvn" 432 | fi 433 | fi 434 | 435 | if describe "lein"; then 436 | if it "can test"; then 437 | do_test_in "lein" 438 | assert 439 | assertEqual "$RUN_RESULT" "lein test" 440 | fi 441 | if it "can run"; then 442 | do_run_in "lein" 443 | assert 444 | assertEqual "$RUN_RESULT" "lein run" 445 | fi 446 | if it "can print tool"; then 447 | do_print_tool_in "lein" 448 | assert 449 | assertEqual "$RUN_RESULT" "lein" 450 | fi 451 | fi 452 | 453 | if describe "dotnet csproj"; then 454 | if it "can build with dotnet"; then 455 | do_build_in "dotnet-csproj" 456 | assert 457 | assertEqual "$RUN_RESULT" "dotnet build" 458 | fi 459 | if it "can run with dotnet"; then 460 | do_run_in "dotnet-csproj" 461 | assert 462 | assertEqual "$RUN_RESULT" "dotnet run" 463 | fi 464 | if it "can test with dotnet"; then 465 | do_test_in "dotnet-csproj" 466 | assert 467 | assertEqual "$RUN_RESULT" "dotnet test" 468 | fi 469 | if it "can print tool"; then 470 | do_print_tool_in "dotnet-csproj" 471 | assert 472 | assertEqual "$RUN_RESULT" "dotnet" 473 | fi 474 | fi 475 | 476 | if describe "dotnet fsproj"; then 477 | if it "can build with dotnet"; then 478 | do_build_in "dotnet-fsproj" 479 | assert 480 | assertEqual "$RUN_RESULT" "dotnet build" 481 | fi 482 | if it "can run with dotnet"; then 483 | do_run_in "dotnet-fsproj" 484 | assert 485 | assertEqual "$RUN_RESULT" "dotnet run" 486 | fi 487 | if it "can test with dotnet"; then 488 | do_test_in "dotnet-fsproj" 489 | assert 490 | assertEqual "$RUN_RESULT" "dotnet test" 491 | fi 492 | if it "can print tool"; then 493 | do_print_tool_in "dotnet-fsproj" 494 | assert 495 | assertEqual "$RUN_RESULT" "dotnet" 496 | fi 497 | fi 498 | 499 | if describe "dotnet sln"; then 500 | if it "can build with dotnet"; then 501 | do_build_in "dotnet-sln" 502 | assert 503 | assertEqual "$RUN_RESULT" "dotnet build" 504 | fi 505 | if it "can run with dotnet"; then 506 | do_run_in "dotnet-sln" 507 | assert 508 | assertEqual "$RUN_RESULT" "dotnet run" 509 | fi 510 | if it "can test with dotnet"; then 511 | do_test_in "dotnet-sln" 512 | assert 513 | assertEqual "$RUN_RESULT" "dotnet test" 514 | fi 515 | if it "can print tool"; then 516 | do_print_tool_in "dotnet-sln" 517 | assert 518 | assertEqual "$RUN_RESULT" "dotnet" 519 | fi 520 | fi 521 | 522 | if describe "dune"; then 523 | if it "can build with dune"; then 524 | do_build_in "dune" 525 | assert 526 | assertEqual "$RUN_RESULT" "dune build" 527 | fi 528 | if it "can run with dune"; then 529 | do_run_in "dune" 530 | assert 531 | assertEqual "$RUN_RESULT" "dune exec" 532 | fi 533 | if it "can test with dune"; then 534 | do_test_in "dune" 535 | assert 536 | assertEqual "$RUN_RESULT" "dune runtest" 537 | fi 538 | if it "can print tool"; then 539 | do_print_tool_in "dune" 540 | assert 541 | assertEqual "$RUN_RESULT" "dune" 542 | fi 543 | fi 544 | 545 | if describe "lake"; then 546 | if it "can run build"; then 547 | do_build_in "lake" 548 | assert 549 | assertEqual "$RUN_RESULT" "lake build" 550 | fi 551 | if it "can run run"; then 552 | do_run_in "lake" 553 | assert 554 | assertEqual "$RUN_RESULT" "lake run" 555 | fi 556 | if it "can run test"; then 557 | do_test_in "lake" 558 | assert 559 | assertEqual "$RUN_RESULT" "lake test" 560 | fi 561 | if it "can print tool"; then 562 | do_print_tool_in "lake" 563 | assert 564 | assertEqual "$RUN_RESULT" "lake" 565 | fi 566 | if it "passes additional arguments to the tool"; then 567 | RUN_RESULT=$(cd tests/lake && ../../projectdo -n build --release) 568 | assertEqual "$RUN_RESULT" "lake build --release" 569 | fi 570 | fi 571 | 572 | if describe "build script"; then 573 | if it "can build with build script"; then 574 | do_build_in "build_script" 575 | assert 576 | assertEqual "$RUN_RESULT" "sh -c build.sh" 577 | fi 578 | fi 579 | 580 | echo "" 581 | 582 | if [ $ANY_ERRORS = true ]; then 583 | exit 1 584 | fi 585 | -------------------------------------------------------------------------------- /tests/build_script/build.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | echo "Build successful" 4 | -------------------------------------------------------------------------------- /tests/bun-lockb/bun.lockb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/paldepind/projectdo/d2b3059e252f7e153695355b25ca103fc4233c14/tests/bun-lockb/bun.lockb -------------------------------------------------------------------------------- /tests/bun-lockb/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "scripts": { 3 | "test": "echo \"Error: no test specified\" && exit 1", 4 | "build": "echo \"Error: no build specified\" && exit 1", 5 | "start": "echo \"Error: no start specified\" && exit 1" 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /tests/bun/bun.lock: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/paldepind/projectdo/d2b3059e252f7e153695355b25ca103fc4233c14/tests/bun/bun.lock -------------------------------------------------------------------------------- /tests/bun/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "scripts": { 3 | "test": "echo \"Error: no test specified\" && exit 1", 4 | "build": "echo \"Error: no build specified\" && exit 1", 5 | "start": "echo \"Error: no start specified\" && exit 1" 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /tests/cargo/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "cargo" 3 | version = "0.1.0" 4 | edition = "2021" 5 | 6 | # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html 7 | 8 | [dependencies] 9 | -------------------------------------------------------------------------------- /tests/cmake/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.10) 2 | project(TestProject) 3 | 4 | enable_testing() 5 | 6 | add_test(NAME example_test COMMAND echo "test passed") 7 | -------------------------------------------------------------------------------- /tests/dotnet-csproj/test.csproj: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/paldepind/projectdo/d2b3059e252f7e153695355b25ca103fc4233c14/tests/dotnet-csproj/test.csproj -------------------------------------------------------------------------------- /tests/dotnet-fsproj/test.fsproj: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/paldepind/projectdo/d2b3059e252f7e153695355b25ca103fc4233c14/tests/dotnet-fsproj/test.fsproj -------------------------------------------------------------------------------- /tests/dotnet-sln/test.sln: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/paldepind/projectdo/d2b3059e252f7e153695355b25ca103fc4233c14/tests/dotnet-sln/test.sln -------------------------------------------------------------------------------- /tests/dune/dune: -------------------------------------------------------------------------------- 1 | (executable 2 | (public_name hello) 3 | (name hello)) 4 | -------------------------------------------------------------------------------- /tests/dune/dune-project: -------------------------------------------------------------------------------- 1 | (lang dune 3.0) 2 | 3 | (name hello) 4 | 5 | (package 6 | (name hello) 7 | (depends ocaml dune)) 8 | -------------------------------------------------------------------------------- /tests/dune/hello.ml: -------------------------------------------------------------------------------- 1 | let () = Printf.printf "Hello, World!\n" 2 | -------------------------------------------------------------------------------- /tests/go/go.mod: -------------------------------------------------------------------------------- 1 | module go 2 | 3 | go 1.19 4 | -------------------------------------------------------------------------------- /tests/gradle/build.gradle: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/paldepind/projectdo/d2b3059e252f7e153695355b25ca103fc4233c14/tests/gradle/build.gradle -------------------------------------------------------------------------------- /tests/just/justfile: -------------------------------------------------------------------------------- 1 | test: 2 | @echo "Tests passed" 3 | 4 | build: 5 | @echo "Built" 6 | 7 | run: 8 | @echo "Ran" 9 | -------------------------------------------------------------------------------- /tests/lake/lakefile.lean: -------------------------------------------------------------------------------- 1 | import Lake 2 | open Lake DSL 3 | 4 | package «testproject» where 5 | -- add package configuration options here 6 | -------------------------------------------------------------------------------- /tests/lein/project.clj: -------------------------------------------------------------------------------- 1 | (defproject example "0.1.0-SNAPSHOT" 2 | :description "Test project for projectdo" 3 | :dependencies [[org.clojure/clojure "1.10.1"]]) 4 | -------------------------------------------------------------------------------- /tests/mage/go.mod: -------------------------------------------------------------------------------- 1 | module mage-test 2 | 3 | go 1.19 4 | -------------------------------------------------------------------------------- /tests/mage/magefile.go: -------------------------------------------------------------------------------- 1 | //go:build mage 2 | 3 | package main 4 | 5 | import ( 6 | "github.com/magefile/mage/sh" 7 | ) 8 | 9 | func Build() error { 10 | if err := sh.Run("go", "mod", "download"); err != nil { 11 | return err 12 | } 13 | return sh.Run("go", "install", "./...") 14 | } 15 | 16 | func Check() error { 17 | if err := sh.Run("go", "mod", "download"); err != nil { 18 | return err 19 | } 20 | return sh.Run("go", "test", "./...") 21 | } 22 | -------------------------------------------------------------------------------- /tests/make-check-with-check-file-and-target/Makefile: -------------------------------------------------------------------------------- 1 | check: 2 | @echo "Tests passed." 3 | -------------------------------------------------------------------------------- /tests/make-check-with-check-file-and-target/check: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/paldepind/projectdo/d2b3059e252f7e153695355b25ca103fc4233c14/tests/make-check-with-check-file-and-target/check -------------------------------------------------------------------------------- /tests/make-check-with-check-file/Makefile: -------------------------------------------------------------------------------- 1 | some-target: 2 | @echo "Tests passed." 3 | -------------------------------------------------------------------------------- /tests/make-check-with-check-file/check: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/paldepind/projectdo/d2b3059e252f7e153695355b25ca103fc4233c14/tests/make-check-with-check-file/check -------------------------------------------------------------------------------- /tests/make-check/Makefile: -------------------------------------------------------------------------------- 1 | check: 2 | @echo "Tests passed." 3 | -------------------------------------------------------------------------------- /tests/make-with-npm/Makefile: -------------------------------------------------------------------------------- 1 | check: 2 | @echo "Tests passed." 3 | -------------------------------------------------------------------------------- /tests/make-with-npm/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "scripts": { 3 | "test": "echo \"Error: no test specified\" && exit 1", 4 | "build": "echo \"Error: no build specified\" && exit 1", 5 | "start": "echo \"Error: no start specified\" && exit 1" 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /tests/maven/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 4.0.0 7 | 8 | com.example 9 | test-project 10 | 1.0.0 11 | 12 | 13 | 11 14 | 11 15 | 16 | 17 | -------------------------------------------------------------------------------- /tests/meson/CMakeLists.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/paldepind/projectdo/d2b3059e252f7e153695355b25ca103fc4233c14/tests/meson/CMakeLists.txt -------------------------------------------------------------------------------- /tests/meson/meson.build: -------------------------------------------------------------------------------- 1 | project('meson', 'c', 2 | version : '0.1', 3 | default_options : ['warning_level=3']) 4 | 5 | exe = executable('meson', 'meson.c', 6 | install : true) 7 | 8 | test('basic', exe) 9 | -------------------------------------------------------------------------------- /tests/meson/meson.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #define PROJECT_NAME "meson" 4 | 5 | int main(int argc, char **argv) { 6 | if(argc != 1) { 7 | printf("%s takes no arguments.\n", argv[0]); 8 | return 1; 9 | } 10 | printf("This is project %s.\n", PROJECT_NAME); 11 | return 0; 12 | } 13 | -------------------------------------------------------------------------------- /tests/nix-flake/flake.nix: -------------------------------------------------------------------------------- 1 | { 2 | description = "A very basic flake"; 3 | 4 | inputs = { 5 | nixpkgs.url = "github:nixos/nixpkgs?ref=nixos-unstable"; 6 | }; 7 | 8 | outputs = { self, nixpkgs }: { 9 | 10 | packages.x86_64-linux.hello = nixpkgs.legacyPackages.x86_64-linux.hello; 11 | 12 | packages.x86_64-linux.default = self.packages.x86_64-linux.hello; 13 | 14 | }; 15 | } 16 | -------------------------------------------------------------------------------- /tests/nix/default.nix: -------------------------------------------------------------------------------- 1 | { ... }: null 2 | -------------------------------------------------------------------------------- /tests/npm-without-test/Makefile: -------------------------------------------------------------------------------- 1 | test: 2 | @echo "Tests passed." 3 | -------------------------------------------------------------------------------- /tests/npm-without-test/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "scripts": { 3 | "test-not": "echo \"Error: no test specified\" && exit 1", 4 | "not-test": "echo \"Error: no test specified\" && exit 1" 5 | }, 6 | "files": [ 7 | "test" 8 | ], 9 | "keywords": [ 10 | "test" 11 | ] 12 | } 13 | -------------------------------------------------------------------------------- /tests/npm/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "scripts": { 3 | "test": "echo \"Error: no test specified\" && exit 1", 4 | "build": "echo \"Error: no build specified\" && exit 1", 5 | "start": "echo \"Error: no start specified\" && exit 1" 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /tests/pnpm/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "scripts": { 3 | "build": "echo \"Error: no build specified\" && exit 1", 4 | "start": "echo \"Error: no start specified\" && exit 1", 5 | "test": "echo \"Error: no test specified\" && exit 1" 6 | } 7 | } -------------------------------------------------------------------------------- /tests/pnpm/pnpm-lock.yaml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/paldepind/projectdo/d2b3059e252f7e153695355b25ca103fc4233c14/tests/pnpm/pnpm-lock.yaml -------------------------------------------------------------------------------- /tests/poetry/pyproject.toml: -------------------------------------------------------------------------------- 1 | [tool.poetry] 2 | name = "poetry" 3 | version = "0.1.0" 4 | description = "" 5 | authors = ["Your Name "] 6 | readme = "README.md" 7 | 8 | [tool.poetry.dependencies] 9 | python = "^3.10" 10 | 11 | 12 | [build-system] 13 | requires = ["poetry-core"] 14 | build-backend = "poetry.core.masonry.api" 15 | -------------------------------------------------------------------------------- /tests/stack/package.yaml: -------------------------------------------------------------------------------- 1 | name: stack 2 | version: 0.1.0.0 3 | github: "githubuser/stack" 4 | license: BSD3 5 | author: "Author name here" 6 | maintainer: "example@example.com" 7 | copyright: "2023 Author name here" 8 | 9 | extra-source-files: 10 | - README.md 11 | - CHANGELOG.md 12 | 13 | # Metadata used when publishing your package 14 | # synopsis: Short description of your package 15 | # category: Web 16 | 17 | # To avoid duplicated efforts in documentation and dealing with the 18 | # complications of embedding Haddock markup inside cabal files, it is 19 | # common to point users to the README.md file. 20 | description: Please see the README on GitHub at 21 | 22 | dependencies: 23 | - base >= 4.7 && < 5 24 | 25 | ghc-options: 26 | - -Wall 27 | - -Wcompat 28 | - -Widentities 29 | - -Wincomplete-record-updates 30 | - -Wincomplete-uni-patterns 31 | - -Wmissing-export-lists 32 | - -Wmissing-home-modules 33 | - -Wpartial-fields 34 | - -Wredundant-constraints 35 | 36 | library: 37 | source-dirs: src 38 | 39 | executables: 40 | stack-exe: 41 | main: Main.hs 42 | source-dirs: app 43 | ghc-options: 44 | - -threaded 45 | - -rtsopts 46 | - -with-rtsopts=-N 47 | dependencies: 48 | - stack 49 | 50 | tests: 51 | stack-test: 52 | main: Spec.hs 53 | source-dirs: test 54 | ghc-options: 55 | - -threaded 56 | - -rtsopts 57 | - -with-rtsopts=-N 58 | dependencies: 59 | - stack 60 | -------------------------------------------------------------------------------- /tests/stack/stack.yaml: -------------------------------------------------------------------------------- 1 | # This file was automatically generated by 'stack init' 2 | # 3 | # Some commonly used options have been documented as comments in this file. 4 | # For advanced use and comprehensive documentation of the format, please see: 5 | # https://docs.haskellstack.org/en/stable/yaml_configuration/ 6 | 7 | # Resolver to choose a 'specific' stackage snapshot or a compiler version. 8 | # A snapshot resolver dictates the compiler version and the set of packages 9 | # to be used for project dependencies. For example: 10 | # 11 | # resolver: lts-3.5 12 | # resolver: nightly-2015-09-21 13 | # resolver: ghc-7.10.2 14 | # 15 | # The location of a snapshot can be provided as a file or url. Stack assumes 16 | # a snapshot provided as a file might change, whereas a url resource does not. 17 | # 18 | # resolver: ./custom-snapshot.yaml 19 | # resolver: https://example.com/snapshots/2018-01-01.yaml 20 | resolver: 21 | url: https://raw.githubusercontent.com/commercialhaskell/stackage-snapshots/master/lts/20/13.yaml 22 | 23 | # User packages to be built. 24 | # Various formats can be used as shown in the example below. 25 | # 26 | # packages: 27 | # - some-directory 28 | # - https://example.com/foo/bar/baz-0.0.2.tar.gz 29 | # subdirs: 30 | # - auto-update 31 | # - wai 32 | packages: 33 | - . 34 | # Dependency packages to be pulled from upstream that are not in the resolver. 35 | # These entries can reference officially published versions as well as 36 | # forks / in-progress versions pinned to a git hash. For example: 37 | # 38 | # extra-deps: 39 | # - acme-missiles-0.3 40 | # - git: https://github.com/commercialhaskell/stack.git 41 | # commit: e7b331f14bcffb8367cd58fbfc8b40ec7642100a 42 | # 43 | # extra-deps: [] 44 | 45 | # Override default flag values for local packages and extra-deps 46 | # flags: {} 47 | 48 | # Extra package databases containing global packages 49 | # extra-package-dbs: [] 50 | 51 | # Control whether we use the GHC we find on the path 52 | # system-ghc: true 53 | # 54 | # Require a specific version of stack, using version ranges 55 | # require-stack-version: -any # Default 56 | # require-stack-version: ">=2.7" 57 | # 58 | # Override the architecture used by stack, especially useful on Windows 59 | # arch: i386 60 | # arch: x86_64 61 | # 62 | # Extra directories used by stack for building 63 | # extra-include-dirs: [/path/to/dir] 64 | # extra-lib-dirs: [/path/to/dir] 65 | # 66 | # Allow a newer minor version of GHC than the snapshot specifies 67 | # compiler-check: newer-minor 68 | -------------------------------------------------------------------------------- /tests/tectonic/Tectonic.toml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/paldepind/projectdo/d2b3059e252f7e153695355b25ca103fc4233c14/tests/tectonic/Tectonic.toml -------------------------------------------------------------------------------- /tests/uv/pyproject.toml: -------------------------------------------------------------------------------- 1 | [project] 2 | name = "uvproject" 3 | version = "0.1.0" 4 | description = "Add your description here" 5 | readme = "README.md" 6 | requires-python = ">=3.13" 7 | dependencies = [] 8 | -------------------------------------------------------------------------------- /tests/uv/uv.lock: -------------------------------------------------------------------------------- 1 | version = 1 2 | revision = 1 3 | requires-python = ">=3.13" 4 | 5 | [[package]] 6 | name = "uvproject" 7 | version = "0.1.0" 8 | source = { virtual = "." } 9 | -------------------------------------------------------------------------------- /tests/yarn-workspace/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "private": true, 3 | "workspaces": ["workspace-a", "workspace-b"] 4 | } 5 | -------------------------------------------------------------------------------- /tests/yarn-workspace/workspace-a/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "workspace-a", 3 | "version": "1.0.0", 4 | "dependencies": {} 5 | } 6 | -------------------------------------------------------------------------------- /tests/yarn-workspace/workspace-b/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "workspace-b", 3 | "version": "1.0.0", 4 | "dependencies": { 5 | "workspace-a": "1.0.0" 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /tests/yarn-workspace/yarn.lock: -------------------------------------------------------------------------------- 1 | # THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. 2 | # yarn lockfile v1 3 | 4 | 5 | -------------------------------------------------------------------------------- /tests/yarn/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "scripts": { 3 | "test": "echo \"Error: no test specified\" && exit 1" 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /tests/yarn/yarn.lock: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/paldepind/projectdo/d2b3059e252f7e153695355b25ca103fc4233c14/tests/yarn/yarn.lock --------------------------------------------------------------------------------