Skip to content

Commit b3b84b3

Browse files
committed
git branches
1 parent f8efef7 commit b3b84b3

10 files changed

Lines changed: 100 additions & 13 deletions

File tree

.github/SECURITY.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ If you discover a security vulnerability, do not open a public issue.
1515

1616
Report it privately by using GitHub Security Advisories:
1717

18-
- https://github.com/SzaBee13/dev-tools-ps/security/advisories/new
18+
- [GitHub Security Advisories](https://github.com/SzaBee13/dev-tools-ps/security/advisories/new)
1919

2020
If that is not possible, contact the maintainer through GitHub and share details privately.
2121

README.md

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Dev PowerShell Utility
22

33
[![GitHub contributors](https://img.shields.io/github/contributors/SzaBee13/dev-tools-ps)](https://github.com/SzaBee13/dev-tools-ps/graphs/contributors)
4-
[![GitHub release](https://img.shields.io/github/v/release/SzaBee13/dev-tools-ps?include_prereleases)](https://github.com/SzaBee13/dev-tools-ps/releases)
4+
[![GitHub release](https://img.shields.io/github/v/release/SzaBee13/dev-tools-ps)](https://github.com/SzaBee13/dev-tools-ps/releases)
55
[![License](https://img.shields.io/github/license/SzaBee13/dev-tools-ps)](https://github.com/SzaBee13/dev-tools-ps/blob/main/LICENSE.md)
66

77
`dev` is a PowerShell function designed to simplify and streamline development workflows on Windows. It allows you to quickly open, create, manage, and version-control projects across multiple development types including web, Python, Discord bots, and more.
@@ -98,7 +98,7 @@ dev local-release <commit-message> [detailed-message] # Commit locally without
9898
```
9999

100100
```powershell
101-
dev init [<git-repo-url>] # Initialize Git repo with optional remote
101+
dev init [<git-repo-url>] [license-name] [--branch <branch-name>] # Initialize Git repo with optional remote and branch override
102102
```
103103

104104
```powershell
@@ -158,11 +158,16 @@ Example:
158158

159159
```json
160160
{
161+
"pullPath": "D:\\pull",
161162
"code": true,
162-
"explorer": true
163+
"explorer": true,
164+
"defaultRoot": "web",
165+
"defaultBranch": "main"
163166
}
164167
```
165168

166169
You can toggle these defaults using the `dev set` command.
167170

171+
`defaultBranch` is used by `dev init` when `--branch` is not provided.
172+
168173
Developed for Windows environments, `dev` centralizes development tasks to save time and reduce repetitive operations.

chocolatey/.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1-
*.nupkg
1+
*.nupkg
2+
packages/

chocolatey/dev-ps-utils.nuspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<package xmlns="http://schemas.microsoft.com/packaging/2015/06/nuspec.xsd">
33
<metadata>
44
<id>dev-ps-utils</id>
5-
<version>1.2.1</version>
5+
<version>1.2.2</version>
66
<packageSourceUrl>https://github.com/SzaBee13/dev-tools-ps</packageSourceUrl>
77
<owners>SzaBee13</owners>
88
<title>Dev PowerShell Utility</title>

example-config.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,6 @@
22
"pullPath": "D:\\pull",
33
"code": true,
44
"explorer": true,
5-
"defaultRoot": "web"
5+
"defaultRoot": "web",
6+
"defaultBranch": "main"
67
}

inno/setup.iss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
; Installer for the Dev command-line tool
33

44
#define MyAppName "Dev PowerShell Utility"
5-
#define MyAppVersion "1.2.1"
5+
#define MyAppVersion "1.2.2"
66
#define MyAppPublisher "SzaBee13"
77
#define MyAppURL "https://github.com/SzaBee13/dev-tools-ps"
88
#define MyAppExeName "dev.ps1"
Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
# v1.2.2
2+
3+
## Release Notes
4+
5+
### Fixed
6+
7+
- Fixed license badge link in README.md
8+
- Fixed Next.js rendering errors in documentation and installation pages
9+
10+
### Added
11+
12+
- Added GitHub issue templates (bug report and feature request) with structured forms
13+
- Added pull request template for better contribution workflow
14+
- Added comprehensive documentation website built with Next.js
15+
- Added releases page on website with version history
16+
- Added Vercel Analytics integration for usage tracking
17+
- Improved `dev list` command functionality
18+
- Updated SECURITY.md with enhanced vulnerability reporting process
19+
- Added CODE_OF_CONDUCT.md and CONTRIBUTING.md for community guidelines
20+
21+
## Download and Install
22+
23+
### Chocolatey
24+
25+
NOTE: The Chocolatey package may not be updated immediately with the latest release. Please check the [Chocolatey page](https://community.chocolatey.org/packages/dev-ps-utils) for the most recent version.
26+
27+
1. Install Chocolatey (if you haven't already):
28+
Read the tutorial at [Chocolatey's official website](https://chocolatey.org/install) for detailed instructions.
29+
30+
2. Install the package:
31+
32+
```powershell
33+
choco install dev-ps-utils -y
34+
```
35+
36+
3. To uninstall:
37+
38+
```powershell
39+
choco uninstall dev-ps-utils -y
40+
```
41+
42+
### Inno Setup (RECOMMENDED)
43+
44+
1. Download the installer from the releases page.
45+
2. Run the installer and follow the prompts to complete the installation.
46+
3. To uninstall, go to "Add or Remove Programs" in Windows, find "Dev PowerShell Utility", and click "Uninstall".
47+
48+
### Build from Source
49+
50+
1. Clone the repository:
51+
52+
```bash
53+
git clone https://github.com/SzaBee13/dev-tools-ps.git
54+
```
55+
56+
2. Navigate to the project directory:
57+
58+
```bash
59+
cd dev-tools-ps
60+
```
61+
62+
3. Run the main script:
63+
64+
```powershell
65+
. .\src\dev.ps1
66+
```
67+
68+
4. Test the `dev` command:
69+
70+
```powershell
71+
dev
72+
```

src/commands/Git.ps1

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,11 +58,15 @@ function Invoke-DevStatus {
5858
function Invoke-DevInit {
5959
param(
6060
[string]$typeOrName,
61-
[string]$name
61+
[string]$name,
62+
[string]$branch,
63+
[string]$defaultBranch
6264
)
65+
66+
$targetBranch = if ($branch) { $branch } elseif ($defaultBranch) { $defaultBranch } else { "main" }
6367

6468
git init
65-
git branch -M main
69+
git branch -M $targetBranch
6670

6771
# Load licenses
6872
$licenses = Get-DevLicenses
@@ -84,7 +88,7 @@ function Invoke-DevInit {
8488
git remote add origin $typeOrName
8589
git add .
8690
git commit -m "Initial commit"
87-
git push -u origin main
91+
git push -u origin $targetBranch
8892
}
8993
else {
9094
git add .

src/core/Config.ps1

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ function Get-DevConfig {
77
explorer = $true
88
pullPath = "D:\pull"
99
driveRoot = "D:\"
10+
defaultBranch = "main"
1011
}
1112

1213
if (Test-Path $ConfigFile) {
@@ -16,6 +17,7 @@ function Get-DevConfig {
1617
$config.explorer = $cfg.explorer
1718
if ($cfg.pullPath) { $config.pullPath = $cfg.pullPath } else { $config.pullPath = "C:\\Users\\$env:USERNAME\\Downloads" }
1819
if ($cfg.driveRoot) { $config.driveRoot = $cfg.driveRoot } else { $config.driveRoot = "C:\\Users\\$env:USERNAME\\Documents" }
20+
if ($cfg.defaultBranch) { $config.defaultBranch = $cfg.defaultBranch }
1921
}
2022
catch {
2123
Write-Host "Failed to load config.json, using defaults." -ForegroundColor Yellow

src/dev.ps1

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ function dev {
2525

2626
[string]$name,
2727

28+
[string]$branch,
29+
2830
[object]$code,
2931
[object]$explorer,
3032

@@ -51,7 +53,7 @@ dev rm <folder-name> - Remove a folder
5153
dev pull [<git-repo-url>] [folder-name] - Clone or pull a git repository into a specified or default folder
5254
dev release <commit-message> [detailed-message] - Commit and push changes to the remote repository
5355
dev local-release <commit-message> [detailed-message] - Commit changes locally without pushing
54-
dev init [<git-repo-url>] - Initialize a new git repository, optionally linking to a remote
56+
dev init [<git-repo-url>] [license-name] [--branch <branch-name>] - Initialize a new git repository, optionally linking to a remote
5557
dev status - Show git status
5658
dev list [--json] - List folders or repositories (--json outputs repos as JSON)
5759
dev ls <root-name> - List folders in specified category
@@ -103,7 +105,7 @@ dev set root <root-name> <path|rm|remove> - Add root to roots (saves to %appdata
103105
Invoke-DevStatus
104106
}
105107
"init" {
106-
Invoke-DevInit -typeOrName $typeOrName -name $name
108+
Invoke-DevInit -typeOrName $typeOrName -name $name -branch $branch -defaultBranch $config.defaultBranch
107109
}
108110
"set" {
109111
Invoke-DevSet -typeOrName $typeOrName -name $name -code $code

0 commit comments

Comments
 (0)