-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from CobusKruger/master
Version 2
- Loading branch information
Showing
14 changed files
with
922 additions
and
4,671 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,3 +2,4 @@ out | |
node_modules | ||
.vscode-test/ | ||
*.vsix | ||
.vscode |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,48 @@ | ||
# Change Log | ||
All notable changes to the "create-combined-script" extension will be documented in this file. | ||
All notable changes to this project will be documented in this file. | ||
|
||
Check [Keep a Changelog](http://keepachangelog.com/) for recommendations on how to structure this file. | ||
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), | ||
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). | ||
|
||
## [Unreleased] | ||
- Initial release | ||
|
||
* Nothing for now. | ||
|
||
## [2.0.0] - 2019-03-27 | ||
|
||
### Overview | ||
This is almost a complete rewrite of the extension, and it's much more customizable and capable than before. | ||
|
||
### Added | ||
1. Instead of being hard-coded to work with `.sql` files, that is now only one possible configuration and you can specify any glob pattern you choose. | ||
2. A table of contents, showing line numbers for each file. | ||
3. Customizable headers and footers for the TOC, the individual script files and the output file itself. | ||
4. You can optionally specify an output filename, instead of having output dumped into a temporary file. | ||
5. Multiple file groups, all with either shared or distinctive headers, footers and more. | ||
6. Multiple output files. You can, for example, have one file for table changes, and another for data changes. | ||
7. Run the extension directly from the command palette to include all the files in the workspace, or using multi-select from the explorer. | ||
8. Configured directly in the Azure Data Studio user or workspace settings, or you can add a configuration file in the workspace root. | ||
|
||
## [1.3.0] - 2018-07-20 | ||
|
||
### Changed | ||
|
||
* Added GO statements after the PRINT statements, to ensure each statement is properly isolated. | ||
|
||
## [1.2.0] - 2018-07-18 | ||
|
||
### Changed | ||
|
||
* Added back the menu item. | ||
|
||
## [1.1.0] - 2018-07-13 | ||
|
||
### Changed | ||
|
||
* Small update to add print statements, so you can see the start and end of scripts as they execute. | ||
* Also added an icon. | ||
|
||
## [1.0.0] - 2018-07-11 | ||
|
||
* This is the initial release. Super excited. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,96 @@ | ||
# Combine Scripts | ||
# Combine Scripts for Azure Data Studio | ||
|
||
Ever needed to execute several scripts spread over several folders? Now you can select several files and folders and generate a single combined file to execute or ab/use any way you choose. | ||
Combines several files spread over several folders. This is useful in many cases. | ||
|
||
1. Combine SQL scripts from your repo into a single file you can use for deployment. | ||
2. Easily create an API doc from Markdown files stored in a folder structure. | ||
3. You get the idea. | ||
|
||
## Features | ||
|
||
A simple need with a simple solution. | ||
Just use `Ctrl` and `Shift` to select multiple files and folders, then right-click and choose *Combine Files*. | ||
|
||
If you select a folder, all matching files in subfolders will also be included. | ||
|
||
The result will be a single file containing the content of all the selected files. By default, there will also be headers and footers for each included file, as well as a table of contents at the top. You can configure all of this either in user settings, or a configuration file. | ||
|
||
## Installation | ||
|
||
Search for *Combine Files* in the VS Code extensions marketplace. | ||
|
||
Alternatively, you can install it from this link: [Visual Studio Code Marketplace](https://marketplace.visualstudio.com/items?itemName=BateleurIO.vscode-combine-scripts) | ||
|
||
## Configuration | ||
|
||
You can change the default configuration in user/workspace settings, or you can place a configuration file named `.combinefilesrc.json` in the workspace root. | ||
|
||
The file looks like this: | ||
|
||
Just use `Ctrl` and `Shift` to select multiple files and folders, then right-click and choose *Combine Scripts*. | ||
```json | ||
{ | ||
"fileGroups": [/*...*/] | ||
} | ||
``` | ||
|
||
If you select a folder, all SQL files in subfolders will also be included. | ||
Each entry in `fileGroups` can have one or more of the following properties: | ||
|
||
The start and end of each script is clearly commented and scripts are separated with `GO` statements. | ||
* `groupName` - Not used. Use this to label multiple configurations. | ||
* `outputFileName` - The name of the output file. If this is not specified, a temporary file is created. | ||
* `fileGlobs` - A list of glob patterns to match. A file is included if it matches *any* glob pattern. Defaults to `**/*.sql` if none is specified. | ||
* `fileHeader` - The lines of text to be placed at the beginning of the output. | ||
* `fileFooter` - The lines of text to be placed at the end of the output. | ||
* `includeToc` - A table of contents will be written after `fileHeader` but before the first `entryHeader` if this is `true`. Defaults to `false`. | ||
* `tocHeader` - If `includeToc === true`, the lines of text to be placed after the `fileHeader`, but before the first `tocEntry`. | ||
* `tocEntry` - If `includeToc === true`, the single line of text that is added once for each included file. Defaults to `'\t${lineNo}\t\t${entryPath}'`, which will show the line number and original file name for each entry. | ||
* `tocFooter` - If `includeToc === true`, the lines of text to be placed after the last `tocEntry`, but before the first `entryHeader`. | ||
* `entryHeader` - The lines of text to be placed at the beginning of each file entry. You can also include the `${entryPath}` variable anywhere in this value. | ||
* `entryFooter` - The lines of text to be placed at the end of each file entry. You can also include the `${entryPath}` variable anywhere in this value. | ||
|
||
## Release Notes | ||
For an example, here is the default configuration for SQL files: | ||
|
||
### 1.0.0 | ||
#### 2018-07-11 | ||
```json | ||
{ | ||
"fileGroups": [{ | ||
"fileGlobs": [ | ||
"**/*.sql" | ||
], | ||
"fileHeader": [ | ||
"/**********************************************************************************", | ||
"* This is a concatenation of all the selected files, including files in subfolders.", | ||
"* The start and end of each file contains a comment with its name, as well as a", | ||
"* print statement.", | ||
"***********************************************************************************" | ||
], | ||
"includeToc": true, | ||
"tocHeader": [ | ||
"* These are the line numbers for the included files:" | ||
], | ||
"tocEntry": "* ${lineNo}\t\t${entryPath}", | ||
"tocFooter": [ | ||
"***********************************************************************************/" | ||
], | ||
"entryHeader": [ | ||
"/*********************************************************************************", | ||
"* Start: ${entryPath}", | ||
"**********************************************************************************/", | ||
"print 'Start: ${entryPath}'", | ||
"GO" | ||
], | ||
"entryFooter": [ | ||
"GO", | ||
"/*********************************************************************************", | ||
"* End: ${entryPath}", | ||
"**********************************************************************************/", | ||
"print 'End: ${entryPath}'", | ||
"GO", | ||
"/*********************************************************************************/" | ||
], | ||
"fileFooter": [] | ||
}] | ||
} | ||
``` | ||
|
||
Initial release. It all works perfectly, of course. | ||
## See Also | ||
|
||
- [Combine Scripts for Azure Data Studio](https://github.com/BateleurIO/azuredatastudio-combine-scripts) is the Azure Data Studio version of this extension. The two are nearly identical, except that the Azure Data Studio version comes configured with defaults for `.sql` files. You can use it to combine other types as well. | ||
- [Combine Files NPM Package](https://www.npmjs.com/package/@cobuskruger/combine-files) [(GitHub)](https://github.com/BateleurIO/combine-files) is an NPM package that combines files with all the same features as this extension. |
Oops, something went wrong.