You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: dev.ps1
+98-42Lines changed: 98 additions & 42 deletions
Original file line number
Diff line number
Diff line change
@@ -7,11 +7,11 @@ function dev {
7
7
8
8
[string]$name,
9
9
10
-
[bool]$code,
11
-
12
-
[bool]$explorer
10
+
[object]$code,# changed
11
+
[object]$explorer# changed
13
12
)
14
13
14
+
15
15
$DriveRoot="D:\"
16
16
$Help=@"
17
17
Usage:
@@ -27,18 +27,9 @@ dev ls <web|python|home|discord|alpha-cpp|alpha-web> - List folders in specified
27
27
28
28
dev set --code=true/false - Open or not code by default (saves to %appdata%/SzaBee13/dev/config.json)
29
29
dev set --explorer=true/false - Open or not explorer by default (saves to %appdata%/SzaBee13/dev/config.json)
30
+
dev set root <root-name> <path|rm|remove> - Add root to roots (saves to %appdata%/SzaBee13/dev/roots.json) if path is rm or remove it'll remove that root from roots.json
30
31
"@
31
32
32
-
# Change these edit add remove
33
-
$roots=@{
34
-
web="D:\!_WEB"
35
-
python="D:\_python"
36
-
home="D:\_home"
37
-
discord="D:\_discord"
38
-
"alpha-cpp"="D:\_alpha\cpp"
39
-
"alpha-web"="D:\_alpha\web"
40
-
}
41
-
42
33
functionSearch-Folder {
43
34
param (
44
35
[string]$rootPath,
@@ -49,6 +40,43 @@ dev set --explorer=true/false - Open or not explorer by default (saves to
49
40
Select-Object-First 1
50
41
}
51
42
43
+
functionConvertTo-Hashtable($object) {
44
+
if ($null-eq$object) { return@{} }
45
+
if ($object-is [hashtable]) { return$object }
46
+
$hash=@{}
47
+
$object.PSObject.Properties|ForEach-Object {
48
+
$hash[$_.Name] =if ($_.Value-is [psobject]) {
49
+
ConvertTo-Hashtable$_.Value
50
+
}
51
+
else {
52
+
$_.Value
53
+
}
54
+
}
55
+
return$hash
56
+
}
57
+
58
+
# Load roots from "%appdata%\SzaBee13\dev\roots.json"
"mit": "MIT License\n\nCopyright (c) [yyyy] SzaBee13\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.",
2
+
"mit": "MIT License\n\nCopyright (c) [yyyy] [name]\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.",
3
3
4
-
"apache2": "Copyright [yyyy] SzaBee13\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\nhttp://www.apache.org/licenses/LICENSE-2.0 \nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License."
4
+
"apache2": "Copyright [yyyy] [name]\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\nhttp://www.apache.org/licenses/LICENSE-2.0 \nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License."
0 commit comments