mirror of
https://github.com/cmderdev/cmder.git
synced 2025-07-17 04:59:09 +08:00
Compare commits
72 Commits
v1.1.4-xpl
...
v1.1.4.1
Author | SHA1 | Date | |
---|---|---|---|
bbcabfb730 | |||
75801cbdc8 | |||
9822fa844e | |||
a9f5d552bc | |||
63120b8998 | |||
8cdce27653 | |||
a5691285ec | |||
3223a0391a | |||
a39c632d71 | |||
8c6847ee0d | |||
f66f598fca | |||
de8d2d22f6 | |||
72c045dc2d | |||
5ee2fb2a8d | |||
2ba40773b3 | |||
662663813e | |||
2ec650557e | |||
932e517c2f | |||
6a9d6dd37e | |||
e9707b2022 | |||
ef91a9c272 | |||
9939b1ba7f | |||
c032b5f8a0 | |||
9ce90d337b | |||
2a722ee3f3 | |||
3cfd032007 | |||
21f0f1dbb2 | |||
38c13a7f4b | |||
97980f5f34 | |||
e3e1effef3 | |||
2542358965 | |||
6b37074dd5 | |||
1b7e647b4b | |||
e6618f21a3 | |||
56a9a2036f | |||
f6c3a0c390 | |||
46f6f677dc | |||
d5d8b0944b | |||
8e676b3fc7 | |||
b9379b3ae2 | |||
db49c14422 | |||
46bebee94c | |||
691000fa15 | |||
df064ec4be | |||
e1c60104ba | |||
3a8daf57f7 | |||
fa33052096 | |||
fe31accba4 | |||
3b053f8848 | |||
c76950293e | |||
ea22c658b7 | |||
303bfda521 | |||
1f8b0c009a | |||
cf74dba780 | |||
a9bfd2d2a2 | |||
b0b8eaef1e | |||
5243d8bb8d | |||
1225d410fa | |||
c661b1f300 | |||
4c1f96c51d | |||
f4b6d8f9a8 | |||
0314ee5d46 | |||
6a761a88c1 | |||
447be262f8 | |||
371ffbc069 | |||
6d0d93e0fd | |||
b4a264b1bc | |||
3bd0fe517f | |||
83cd726a41 | |||
b30056c4b3 | |||
7688823886 | |||
878499cc0b |
4
.gitignore
vendored
4
.gitignore
vendored
@ -4,6 +4,10 @@
|
|||||||
vendor/*
|
vendor/*
|
||||||
!vendor/*.md
|
!vendor/*.md
|
||||||
!vendor/*.bat
|
!vendor/*.bat
|
||||||
|
!vendor/*.json
|
||||||
|
|
||||||
config/.history
|
config/.history
|
||||||
Thumbs.db
|
Thumbs.db
|
||||||
*.exe
|
*.exe
|
||||||
|
build/
|
||||||
|
Version v*
|
21
Readme.md
21
Readme.md
@ -1,8 +1,8 @@
|
|||||||
# Cmder
|
# Cmder
|
||||||
|
|
||||||
Latest release is **[v1.1.3](https://github.com/bliker/cmder/releases/tag/v1.1.3)**
|
Latest release is **[v1.1.4](https://github.com/bliker/cmder/releases/tag/v1.1.4)**
|
||||||
|
|
||||||
Cmder is a **software package** created out of pure frustration over absence of usable console emulator on Windows. It is based on [ConEmu](https://code.google.com/p/conemu-maximus5/) with *major* config overhaul. Monokai color scheme, amazing [clink](https://code.google.com/p/clink/) and custom prompt layout.
|
Cmder is a **software package** created out of pure frustration over absence of usable console emulator on Windows. It is based on [ConEmu](https://code.google.com/p/conemu-maximus5/) with *major* config overhaul. Monokai color scheme, amazing [clink](https://github.com/mridgers/clink) and custom prompt layout.
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
@ -19,6 +19,20 @@ The main advantage of Cmder is portability. It is designed to be totally self-co
|
|||||||
|
|
||||||
*(There will be a version with installer)*
|
*(There will be a version with installer)*
|
||||||
|
|
||||||
|
## Integration
|
||||||
|
|
||||||
|
So you've experimented with cmder a little and want to give it a shot in a more permanent home;
|
||||||
|
|
||||||
|
### Shortcut to open Cmder in a chosen folder
|
||||||
|
|
||||||
|
1. Open a terminal as an Administrator
|
||||||
|
1. Navigate to the directory you have placed Cmder
|
||||||
|
1. Execute `.\cmder.exe /REGISTER ALL`*
|
||||||
|
|
||||||
|
In a file explorer window right click in or on a directory to see "Cmder Here" in the context menu.
|
||||||
|
|
||||||
|
*If you get a message "Access Denied" ensure you are executing the command in an Administrator prompt.
|
||||||
|
|
||||||
## Keyboard shortcuts
|
## Keyboard shortcuts
|
||||||
|
|
||||||
### Tab manipulation
|
### Tab manipulation
|
||||||
@ -52,7 +66,8 @@ All aliases will be saved in `/config/aliases` file
|
|||||||
1. Complete PowerShell compatibility.
|
1. Complete PowerShell compatibility.
|
||||||
2. Workaround git.exe overload after msysgit download (Granted this is an upstream issue).
|
2. Workaround git.exe overload after msysgit download (Granted this is an upstream issue).
|
||||||
3. Redo Build/Pack scripts or remove them altogether.
|
3. Redo Build/Pack scripts or remove them altogether.
|
||||||
4. Launcher XP compatibility.
|
4. Git Bash
|
||||||
|
5. Check for clink and git before injecting them
|
||||||
|
|
||||||
## License
|
## License
|
||||||
|
|
||||||
|
125
build.rb
125
build.rb
@ -1,125 +0,0 @@
|
|||||||
# Samuel Vasko 2013
|
|
||||||
# Cmder build script
|
|
||||||
# Like really a beta
|
|
||||||
#
|
|
||||||
# This script downloads dependencies form google code. Each software is extracted
|
|
||||||
# in a folder with same name as the project on google code. So Conemu becomes
|
|
||||||
# conemu-maximus5. Correct files are beeing picked by using labels.
|
|
||||||
# I will move the script for getting files by labels from php to here as soon I feel like it
|
|
||||||
|
|
||||||
require 'fileutils'
|
|
||||||
require 'open-uri'
|
|
||||||
require 'uri'
|
|
||||||
|
|
||||||
def get_file project, query
|
|
||||||
urlToFile = URI.escape('http://samuelvasko.tk/gcode/?project='+project+'&query='+query)
|
|
||||||
open(urlToFile) do |resp|
|
|
||||||
urlToFile = URI.escape(resp.read.split(/\r?\n/).first)
|
|
||||||
end
|
|
||||||
|
|
||||||
extension = urlToFile.split('.').last
|
|
||||||
filename = project+'.'+extension
|
|
||||||
|
|
||||||
puts "\n ------ Downloading #{project} from #{urlToFile} ------- \n \n"
|
|
||||||
begin
|
|
||||||
open(urlToFile, 'rb') do |infile|
|
|
||||||
open(filename, 'wb') do |outfile|
|
|
||||||
outfile.write(infile.read)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
rescue IOError => error
|
|
||||||
puts error
|
|
||||||
FileUtils.rm(filename) if File.exists?(filename)
|
|
||||||
exit(1)
|
|
||||||
end
|
|
||||||
|
|
||||||
system("7z x -o\"#{project}\" #{filename}")
|
|
||||||
|
|
||||||
File.unlink(project+"."+extension);
|
|
||||||
|
|
||||||
# When the folder contains another folder
|
|
||||||
# that is not what we want
|
|
||||||
if Dir.glob("#{project}/*").length == 1
|
|
||||||
temp_name = "#{project}_temp"
|
|
||||||
FileUtils.mv(project, temp_name)
|
|
||||||
FileUtils.mv(Dir.glob("#{temp_name}/*")[0], project)
|
|
||||||
FileUtils.rm_r(temp_name)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
def find_on_path exe
|
|
||||||
path = ENV['PATH'].split(File::PATH_SEPARATOR)
|
|
||||||
for dir in path
|
|
||||||
if File.exists?(File.join(dir, exe))
|
|
||||||
return true
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
return false
|
|
||||||
end
|
|
||||||
|
|
||||||
puts '
|
|
||||||
______ _ _ _ _ _
|
|
||||||
| ___ \ (_) | | (_) | |
|
|
||||||
| |_/ /_ _ _| | __| |_ _ __ __ _ ___ _ __ ___ __| | ___ _ __
|
|
||||||
| ___ \ | | | | |/ _` | | \'_ \ / _` | / __| \'_ ` _ \ / _` |/ _ \ \'__|
|
|
||||||
| |_/ / |_| | | | (_| | | | | | (_| | | (__| | | | | | (_| | __/ |
|
|
||||||
\____/ \__,_|_|_|\__,_|_|_| |_|\__, | \___|_| |_| |_|\__,_|\___|_|
|
|
||||||
__/ |
|
|
||||||
|___/
|
|
||||||
'
|
|
||||||
|
|
||||||
unless find_on_path('7z.exe')
|
|
||||||
puts '7z.exe not found. Ensure 7-zip is installed and on the PATH.'
|
|
||||||
exit(1)
|
|
||||||
end
|
|
||||||
|
|
||||||
build_exe = true
|
|
||||||
unless find_on_path('msbuild.exe')
|
|
||||||
puts 'msbuild.exe not found. We need that to build the executable.'
|
|
||||||
puts 'Do you want to continue? [Y/n]'
|
|
||||||
build_exe = false
|
|
||||||
exit(1) unless gets.chomp.downcase == 'y'
|
|
||||||
end
|
|
||||||
|
|
||||||
puts 'Cleanup'
|
|
||||||
|
|
||||||
if Dir.exists?('vendor')
|
|
||||||
Dir.glob('vendor/*') { |file| FileUtils.rm_rf(file) if File.directory?(file) }
|
|
||||||
end
|
|
||||||
|
|
||||||
Dir.chdir('vendor')
|
|
||||||
|
|
||||||
puts 'Getting files'
|
|
||||||
|
|
||||||
get_file('clink', 'label:Type-Archive label:Featured')
|
|
||||||
get_file('conemu-maximus5', 'label:Type-Archive label:Preview label:Featured')
|
|
||||||
get_file('msysgit', 'label:Type-Archive label:Featured')
|
|
||||||
|
|
||||||
puts 'Creating executable'
|
|
||||||
|
|
||||||
puts 'Build for XP? (Default: No)'
|
|
||||||
if gets.downcase =='yes' or 'y'
|
|
||||||
XP = true
|
|
||||||
elsif gets.downcase == 'no' or 'n'
|
|
||||||
XP = false
|
|
||||||
else
|
|
||||||
puts 'Defaulting to non-XP build'
|
|
||||||
XP = false
|
|
||||||
end
|
|
||||||
|
|
||||||
if build_exe
|
|
||||||
Dir.chdir('../launcher')
|
|
||||||
if XP
|
|
||||||
puts 'Building XP Compatible Launcher...'
|
|
||||||
status = system('msbuild /p:Configuration=ReleaseXP')
|
|
||||||
else
|
|
||||||
status = system('msbuild /p:Configuration=Release')
|
|
||||||
end
|
|
||||||
unless status
|
|
||||||
puts 'Looks like the build failed'
|
|
||||||
exit(1)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
puts 'Done, bye'
|
|
@ -349,7 +349,7 @@
|
|||||||
<value name="SwitchGuiFocus" type="dword" data="00000000"/>
|
<value name="SwitchGuiFocus" type="dword" data="00000000"/>
|
||||||
<value name="SetFocusGui" type="dword" data="00000000"/>
|
<value name="SetFocusGui" type="dword" data="00000000"/>
|
||||||
<value name="SetFocusChild" type="dword" data="00000000"/>
|
<value name="SetFocusChild" type="dword" data="00000000"/>
|
||||||
<value name="ChildSystemMenu" type="dword" data="00000000"/>
|
<value name="ChildSystemMenu" type="dword" data="006b2d288000000"/>
|
||||||
<value name="Multi.NewConsole" type="dword" data="80808000"/>
|
<value name="Multi.NewConsole" type="dword" data="80808000"/>
|
||||||
<value name="Multi.NewConsoleShift" type="dword" data="00001154"/>
|
<value name="Multi.NewConsoleShift" type="dword" data="00001154"/>
|
||||||
<value name="Multi.NewConsolePopup" type="dword" data="80808000"/>
|
<value name="Multi.NewConsolePopup" type="dword" data="80808000"/>
|
||||||
@ -488,7 +488,7 @@
|
|||||||
<key name="Task1" modified="2014-01-21 18:36:36" build="131215">
|
<key name="Task1" modified="2014-01-21 18:36:36" build="131215">
|
||||||
<value name="Name" type="string" data="{cmd}"/>
|
<value name="Name" type="string" data="{cmd}"/>
|
||||||
<value name="GuiArgs" type="string" data=" /icon "%CMDER_ROOT%\cmder.exe""/>
|
<value name="GuiArgs" type="string" data=" /icon "%CMDER_ROOT%\cmder.exe""/>
|
||||||
<value name="Cmd1" type="string" data="cmd /k "%CMDER_ROOT%\vendor\init.bat" -new_console:d:%USERPROFILE%"/>
|
<value name="Cmd1" type="string" data="cmd /k "%ConEmuDir%\..\init.bat" -new_console:d:%HOME%"/>
|
||||||
<value name="Active" type="dword" data="00000000"/>
|
<value name="Active" type="dword" data="00000000"/>
|
||||||
<value name="Count" type="dword" data="00000001"/>
|
<value name="Count" type="dword" data="00000001"/>
|
||||||
<value name="Hotkey" type="dword" data="00000000"/>
|
<value name="Hotkey" type="dword" data="00000000"/>
|
||||||
@ -505,8 +505,8 @@
|
|||||||
<key name="Apps" modified="2014-01-21 18:36:36" build="131215">
|
<key name="Apps" modified="2014-01-21 18:36:36" build="131215">
|
||||||
<value name="Count" type="dword" data="00000000"/>
|
<value name="Count" type="dword" data="00000000"/>
|
||||||
</key>
|
</key>
|
||||||
<key name="Colors" modified="2014-01-31 17:13:53" build="131107">
|
<key name="Colors" modified="2014-01-21 18:36:36" build="131215">
|
||||||
<key name="Palette1" modified="2014-01-31 17:13:53" build="131107">
|
<key name="Palette1" modified="2014-01-21 18:36:36" build="131215">
|
||||||
<value name="Name" type="string" data="Monokai"/>
|
<value name="Name" type="string" data="Monokai"/>
|
||||||
<value name="ExtendColors" type="hex" data="00"/>
|
<value name="ExtendColors" type="hex" data="00"/>
|
||||||
<value name="ExtendColorIdx" type="hex" data="0e"/>
|
<value name="ExtendColorIdx" type="hex" data="0e"/>
|
||||||
|
@ -8,19 +8,13 @@ EndProject
|
|||||||
Global
|
Global
|
||||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||||
Debug|Win32 = Debug|Win32
|
Debug|Win32 = Debug|Win32
|
||||||
DebugXP|Win32 = DebugXP|Win32
|
|
||||||
Release|Win32 = Release|Win32
|
Release|Win32 = Release|Win32
|
||||||
ReleaseXP|Win32 = ReleaseXP|Win32
|
|
||||||
EndGlobalSection
|
EndGlobalSection
|
||||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||||
{4A8485A5-B7DD-4C44-B7F6-3E2765DD0CD3}.Debug|Win32.ActiveCfg = Debug|Win32
|
{4A8485A5-B7DD-4C44-B7F6-3E2765DD0CD3}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||||
{4A8485A5-B7DD-4C44-B7F6-3E2765DD0CD3}.Debug|Win32.Build.0 = Debug|Win32
|
{4A8485A5-B7DD-4C44-B7F6-3E2765DD0CD3}.Debug|Win32.Build.0 = Debug|Win32
|
||||||
{4A8485A5-B7DD-4C44-B7F6-3E2765DD0CD3}.DebugXP|Win32.ActiveCfg = DebugXP|Win32
|
|
||||||
{4A8485A5-B7DD-4C44-B7F6-3E2765DD0CD3}.DebugXP|Win32.Build.0 = DebugXP|Win32
|
|
||||||
{4A8485A5-B7DD-4C44-B7F6-3E2765DD0CD3}.Release|Win32.ActiveCfg = Release|Win32
|
{4A8485A5-B7DD-4C44-B7F6-3E2765DD0CD3}.Release|Win32.ActiveCfg = Release|Win32
|
||||||
{4A8485A5-B7DD-4C44-B7F6-3E2765DD0CD3}.Release|Win32.Build.0 = Release|Win32
|
{4A8485A5-B7DD-4C44-B7F6-3E2765DD0CD3}.Release|Win32.Build.0 = Release|Win32
|
||||||
{4A8485A5-B7DD-4C44-B7F6-3E2765DD0CD3}.ReleaseXP|Win32.ActiveCfg = ReleaseXP|Win32
|
|
||||||
{4A8485A5-B7DD-4C44-B7F6-3E2765DD0CD3}.ReleaseXP|Win32.Build.0 = ReleaseXP|Win32
|
|
||||||
EndGlobalSection
|
EndGlobalSection
|
||||||
GlobalSection(SolutionProperties) = preSolution
|
GlobalSection(SolutionProperties) = preSolution
|
||||||
HideSolutionNode = FALSE
|
HideSolutionNode = FALSE
|
||||||
|
@ -1,18 +1,10 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||||
<ItemGroup Label="ProjectConfigurations">
|
<ItemGroup Label="ProjectConfigurations">
|
||||||
<ProjectConfiguration Include="DebugXP|Win32">
|
|
||||||
<Configuration>DebugXP</Configuration>
|
|
||||||
<Platform>Win32</Platform>
|
|
||||||
</ProjectConfiguration>
|
|
||||||
<ProjectConfiguration Include="Debug|Win32">
|
<ProjectConfiguration Include="Debug|Win32">
|
||||||
<Configuration>Debug</Configuration>
|
<Configuration>Debug</Configuration>
|
||||||
<Platform>Win32</Platform>
|
<Platform>Win32</Platform>
|
||||||
</ProjectConfiguration>
|
</ProjectConfiguration>
|
||||||
<ProjectConfiguration Include="ReleaseXP|Win32">
|
|
||||||
<Configuration>ReleaseXP</Configuration>
|
|
||||||
<Platform>Win32</Platform>
|
|
||||||
</ProjectConfiguration>
|
|
||||||
<ProjectConfiguration Include="Release|Win32">
|
<ProjectConfiguration Include="Release|Win32">
|
||||||
<Configuration>Release</Configuration>
|
<Configuration>Release</Configuration>
|
||||||
<Platform>Win32</Platform>
|
<Platform>Win32</Platform>
|
||||||
@ -30,12 +22,6 @@
|
|||||||
<PlatformToolset>v120</PlatformToolset>
|
<PlatformToolset>v120</PlatformToolset>
|
||||||
<CharacterSet>Unicode</CharacterSet>
|
<CharacterSet>Unicode</CharacterSet>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='DebugXP|Win32'" Label="Configuration">
|
|
||||||
<ConfigurationType>Application</ConfigurationType>
|
|
||||||
<UseDebugLibraries>true</UseDebugLibraries>
|
|
||||||
<PlatformToolset>v120_xp</PlatformToolset>
|
|
||||||
<CharacterSet>Unicode</CharacterSet>
|
|
||||||
</PropertyGroup>
|
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
||||||
<ConfigurationType>Application</ConfigurationType>
|
<ConfigurationType>Application</ConfigurationType>
|
||||||
<UseDebugLibraries>false</UseDebugLibraries>
|
<UseDebugLibraries>false</UseDebugLibraries>
|
||||||
@ -43,45 +29,24 @@
|
|||||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||||
<CharacterSet>Unicode</CharacterSet>
|
<CharacterSet>Unicode</CharacterSet>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseXP|Win32'" Label="Configuration">
|
|
||||||
<ConfigurationType>Application</ConfigurationType>
|
|
||||||
<UseDebugLibraries>false</UseDebugLibraries>
|
|
||||||
<PlatformToolset>v120_xp</PlatformToolset>
|
|
||||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
|
||||||
<CharacterSet>Unicode</CharacterSet>
|
|
||||||
</PropertyGroup>
|
|
||||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||||
<ImportGroup Label="ExtensionSettings">
|
<ImportGroup Label="ExtensionSettings">
|
||||||
</ImportGroup>
|
</ImportGroup>
|
||||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||||
</ImportGroup>
|
</ImportGroup>
|
||||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='DebugXP|Win32'" Label="PropertySheets">
|
|
||||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
|
||||||
</ImportGroup>
|
|
||||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||||
</ImportGroup>
|
</ImportGroup>
|
||||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseXP|Win32'" Label="PropertySheets">
|
|
||||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
|
||||||
</ImportGroup>
|
|
||||||
<PropertyGroup Label="UserMacros" />
|
<PropertyGroup Label="UserMacros" />
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||||
<LinkIncremental>true</LinkIncremental>
|
<LinkIncremental>true</LinkIncremental>
|
||||||
<TargetName>Cmder</TargetName>
|
<TargetName>Cmder</TargetName>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='DebugXP|Win32'">
|
|
||||||
<LinkIncremental>true</LinkIncremental>
|
|
||||||
<TargetName>Cmder</TargetName>
|
|
||||||
</PropertyGroup>
|
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||||
<LinkIncremental>false</LinkIncremental>
|
<LinkIncremental>false</LinkIncremental>
|
||||||
<TargetName>Cmder</TargetName>
|
<TargetName>Cmder</TargetName>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseXP|Win32'">
|
|
||||||
<LinkIncremental>false</LinkIncremental>
|
|
||||||
<TargetName>Cmder</TargetName>
|
|
||||||
</PropertyGroup>
|
|
||||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||||
<ClCompile>
|
<ClCompile>
|
||||||
<PrecompiledHeader>
|
<PrecompiledHeader>
|
||||||
@ -96,20 +61,6 @@
|
|||||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||||
</Link>
|
</Link>
|
||||||
</ItemDefinitionGroup>
|
</ItemDefinitionGroup>
|
||||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='DebugXP|Win32'">
|
|
||||||
<ClCompile>
|
|
||||||
<PrecompiledHeader>
|
|
||||||
</PrecompiledHeader>
|
|
||||||
<WarningLevel>Level3</WarningLevel>
|
|
||||||
<Optimization>Disabled</Optimization>
|
|
||||||
<PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;XP;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
|
||||||
<SDLCheck>true</SDLCheck>
|
|
||||||
</ClCompile>
|
|
||||||
<Link>
|
|
||||||
<SubSystem>Windows</SubSystem>
|
|
||||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
|
||||||
</Link>
|
|
||||||
</ItemDefinitionGroup>
|
|
||||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||||
<ClCompile>
|
<ClCompile>
|
||||||
<WarningLevel>Level3</WarningLevel>
|
<WarningLevel>Level3</WarningLevel>
|
||||||
@ -132,28 +83,6 @@
|
|||||||
<Command>copy $(TargetPath) $(SolutionDir)..\$(TargetFileName)</Command>
|
<Command>copy $(TargetPath) $(SolutionDir)..\$(TargetFileName)</Command>
|
||||||
</PostBuildEvent>
|
</PostBuildEvent>
|
||||||
</ItemDefinitionGroup>
|
</ItemDefinitionGroup>
|
||||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseXP|Win32'">
|
|
||||||
<ClCompile>
|
|
||||||
<WarningLevel>Level3</WarningLevel>
|
|
||||||
<PrecompiledHeader>
|
|
||||||
</PrecompiledHeader>
|
|
||||||
<Optimization>MinSpace</Optimization>
|
|
||||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
|
||||||
<IntrinsicFunctions>false</IntrinsicFunctions>
|
|
||||||
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;XP;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
|
||||||
<SDLCheck>true</SDLCheck>
|
|
||||||
<FavorSizeOrSpeed>Size</FavorSizeOrSpeed>
|
|
||||||
</ClCompile>
|
|
||||||
<Link>
|
|
||||||
<SubSystem>Windows</SubSystem>
|
|
||||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
|
||||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
|
||||||
<OptimizeReferences>true</OptimizeReferences>
|
|
||||||
</Link>
|
|
||||||
<PostBuildEvent>
|
|
||||||
<Command>copy $(TargetPath) $(SolutionDir)..\$(TargetFileName)</Command>
|
|
||||||
</PostBuildEvent>
|
|
||||||
</ItemDefinitionGroup>
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ResourceCompile Include="src\Resource.rc" />
|
<ResourceCompile Include="src\Resource.rc" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
@ -12,8 +12,11 @@
|
|||||||
|
|
||||||
#define USE_TASKBAR_API (_WIN32_WINNT >= _WIN32_WINNT_WIN7)
|
#define USE_TASKBAR_API (_WIN32_WINNT >= _WIN32_WINNT_WIN7)
|
||||||
|
|
||||||
|
#define XP (_WIN32_WINNT < _WIN32_WINNT_VISTA)
|
||||||
|
|
||||||
#define MB_TITLE L"Cmder Launcher"
|
#define MB_TITLE L"Cmder Launcher"
|
||||||
#define SHELL_MENU_REGISTRY_PATH L"Directory\\Background\\shell\\Cmder"
|
#define SHELL_MENU_REGISTRY_PATH_BACKGROUND L"Directory\\Background\\shell\\Cmder"
|
||||||
|
#define SHELL_MENU_REGISTRY_PATH_LISTITEM L"Directory\\shell\\Cmder"
|
||||||
|
|
||||||
#define streqi(a, b) (_wcsicmp((a), (b)) == 0)
|
#define streqi(a, b) (_wcsicmp((a), (b)) == 0)
|
||||||
|
|
||||||
@ -154,30 +157,42 @@ HKEY GetRootKey(std::wstring opt)
|
|||||||
return root;
|
return root;
|
||||||
}
|
}
|
||||||
|
|
||||||
void RegisterShellMenu(std::wstring opt)
|
void RegisterShellMenu(std::wstring opt, wchar_t* keyBaseName)
|
||||||
{
|
{
|
||||||
HKEY root = GetRootKey(opt);
|
// First, get the paths we will use
|
||||||
|
|
||||||
HKEY cmderKey;
|
|
||||||
FAIL_ON_ERROR(
|
|
||||||
RegCreateKeyEx(root, SHELL_MENU_REGISTRY_PATH, 0, NULL,
|
|
||||||
REG_OPTION_NON_VOLATILE, KEY_ALL_ACCESS, NULL, &cmderKey, NULL));
|
|
||||||
|
|
||||||
FAIL_ON_ERROR(RegSetValue(cmderKey, L"", REG_SZ, L"Cmder Here", NULL));
|
|
||||||
FAIL_ON_ERROR(RegSetValueEx(cmderKey, L"NoWorkingDirectory", 0, REG_SZ, (BYTE *)L"", 2));
|
|
||||||
|
|
||||||
HKEY command;
|
|
||||||
FAIL_ON_ERROR(
|
|
||||||
RegCreateKeyEx(cmderKey, L"command", 0, NULL,
|
|
||||||
REG_OPTION_NON_VOLATILE, KEY_ALL_ACCESS, NULL, &command, NULL));
|
|
||||||
|
|
||||||
wchar_t exePath[MAX_PATH] = { 0 };
|
wchar_t exePath[MAX_PATH] = { 0 };
|
||||||
|
wchar_t icoPath[MAX_PATH] = { 0 };
|
||||||
|
|
||||||
GetModuleFileName(NULL, exePath, sizeof(exePath));
|
GetModuleFileName(NULL, exePath, sizeof(exePath));
|
||||||
|
|
||||||
wchar_t commandStr[MAX_PATH + 20] = { 0 };
|
wchar_t commandStr[MAX_PATH + 20] = { 0 };
|
||||||
swprintf_s(commandStr, L"\"%s\" \"%%V\"", exePath);
|
swprintf_s(commandStr, L"\"%s\" \"%%V\"", exePath);
|
||||||
|
|
||||||
|
// Now that we have `commandStr`, it's OK to change `exePath`...
|
||||||
|
PathRemoveFileSpec(exePath);
|
||||||
|
|
||||||
|
PathCombine(icoPath, exePath, L"icons\\cmder.ico");
|
||||||
|
|
||||||
|
// Now set the registry keys
|
||||||
|
|
||||||
|
HKEY root = GetRootKey(opt);
|
||||||
|
|
||||||
|
HKEY cmderKey;
|
||||||
|
FAIL_ON_ERROR(
|
||||||
|
RegCreateKeyEx(root, keyBaseName, 0, NULL,
|
||||||
|
REG_OPTION_NON_VOLATILE, KEY_ALL_ACCESS, NULL, &cmderKey, NULL));
|
||||||
|
|
||||||
|
FAIL_ON_ERROR(RegSetValue(cmderKey, L"", REG_SZ, L"Cmder Here", NULL));
|
||||||
|
FAIL_ON_ERROR(RegSetValueEx(cmderKey, L"NoWorkingDirectory", 0, REG_SZ, (BYTE *)L"", 2));
|
||||||
|
|
||||||
|
FAIL_ON_ERROR(RegSetValueEx(cmderKey, L"Icon", 0, REG_SZ, (BYTE *)icoPath, wcslen(icoPath) * sizeof(wchar_t)));
|
||||||
|
|
||||||
|
HKEY command;
|
||||||
|
FAIL_ON_ERROR(
|
||||||
|
RegCreateKeyEx(cmderKey, L"command", 0, NULL,
|
||||||
|
REG_OPTION_NON_VOLATILE, KEY_ALL_ACCESS, NULL, &command, NULL));
|
||||||
|
|
||||||
FAIL_ON_ERROR(RegSetValue(command, L"", REG_SZ, commandStr, NULL));
|
FAIL_ON_ERROR(RegSetValue(command, L"", REG_SZ, commandStr, NULL));
|
||||||
|
|
||||||
RegCloseKey(command);
|
RegCloseKey(command);
|
||||||
@ -185,19 +200,17 @@ void RegisterShellMenu(std::wstring opt)
|
|||||||
RegCloseKey(root);
|
RegCloseKey(root);
|
||||||
}
|
}
|
||||||
|
|
||||||
void UnregisterShellMenu(std::wstring opt)
|
void UnregisterShellMenu(std::wstring opt, wchar_t* keyBaseName)
|
||||||
{
|
{
|
||||||
HKEY root = GetRootKey(opt);
|
HKEY root = GetRootKey(opt);
|
||||||
HKEY cmderKey;
|
HKEY cmderKey;
|
||||||
FAIL_ON_ERROR(
|
FAIL_ON_ERROR(
|
||||||
RegCreateKeyEx(root, SHELL_MENU_REGISTRY_PATH, 0, NULL,
|
RegCreateKeyEx(root, keyBaseName, 0, NULL,
|
||||||
REG_OPTION_NON_VOLATILE, KEY_ALL_ACCESS, NULL, &cmderKey, NULL));
|
REG_OPTION_NON_VOLATILE, KEY_ALL_ACCESS, NULL, &cmderKey, NULL));
|
||||||
#ifdef XP
|
#if XP
|
||||||
FAIL_ON_ERROR(SHDeleteKey(cmderKey, NULL));
|
FAIL_ON_ERROR(SHDeleteKey(cmderKey, NULL));
|
||||||
FAIL_ON_ERROR(SHDeleteKey(root, SHELL_MENU_REGISTRY_PATH));
|
|
||||||
#else
|
#else
|
||||||
FAIL_ON_ERROR(RegDeleteTree(cmderKey, NULL));
|
FAIL_ON_ERROR(RegDeleteTree(cmderKey, NULL));
|
||||||
FAIL_ON_ERROR(RegDeleteKey(root, SHELL_MENU_REGISTRY_PATH));
|
|
||||||
#endif
|
#endif
|
||||||
RegCloseKey(cmderKey);
|
RegCloseKey(cmderKey);
|
||||||
RegCloseKey(root);
|
RegCloseKey(root);
|
||||||
@ -220,11 +233,13 @@ int APIENTRY _tWinMain(_In_ HINSTANCE hInstance,
|
|||||||
}
|
}
|
||||||
else if (streqi(opt.first.c_str(), L"/REGISTER"))
|
else if (streqi(opt.first.c_str(), L"/REGISTER"))
|
||||||
{
|
{
|
||||||
RegisterShellMenu(opt.second);
|
RegisterShellMenu(opt.second, SHELL_MENU_REGISTRY_PATH_BACKGROUND);
|
||||||
|
RegisterShellMenu(opt.second, SHELL_MENU_REGISTRY_PATH_LISTITEM);
|
||||||
}
|
}
|
||||||
else if (streqi(opt.first.c_str(), L"/UNREGISTER"))
|
else if (streqi(opt.first.c_str(), L"/UNREGISTER"))
|
||||||
{
|
{
|
||||||
UnregisterShellMenu(opt.second);
|
UnregisterShellMenu(opt.second, SHELL_MENU_REGISTRY_PATH_BACKGROUND);
|
||||||
|
UnregisterShellMenu(opt.second, SHELL_MENU_REGISTRY_PATH_LISTITEM);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -233,4 +248,4 @@ int APIENTRY _tWinMain(_In_ HINSTANCE hInstance,
|
|||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
40
pack.rb
40
pack.rb
@ -1,40 +0,0 @@
|
|||||||
# Samuel Vasko 2013
|
|
||||||
# Cmder packing script -- Creates zip files for relase
|
|
||||||
|
|
||||||
require "fileutils"
|
|
||||||
|
|
||||||
def create_archive name, exclude
|
|
||||||
if exclude
|
|
||||||
exclude = " -x!cmder\\" + exclude
|
|
||||||
else
|
|
||||||
exclude = ""
|
|
||||||
end
|
|
||||||
system('ls')
|
|
||||||
puts "Running 7z a -x@cmder\\packignore" + exclude + " " + name + " cmder"
|
|
||||||
system("7z a -x@cmder\\packignore" + exclude + " " + name + " cmder")
|
|
||||||
end
|
|
||||||
|
|
||||||
targets = [
|
|
||||||
["cmder.zip"],
|
|
||||||
["cmder.7z"],
|
|
||||||
["cmder_mini.zip", "vendor\\msysgit"]
|
|
||||||
]
|
|
||||||
|
|
||||||
unless system("git describe --abbrev=0 --tags")
|
|
||||||
puts "Failied to get the last tag from git, looks like something is missing"
|
|
||||||
end
|
|
||||||
|
|
||||||
version = `git describe --abbrev=0 --tags`
|
|
||||||
|
|
||||||
FileUtils.touch('Version ' + version.chomp)
|
|
||||||
FileUtils.rm('config/.history') if File.exists?('config/.history')
|
|
||||||
|
|
||||||
Dir.chdir('..')
|
|
||||||
|
|
||||||
targets.each do |ar|
|
|
||||||
create_archive ar[0], ar[1]
|
|
||||||
end
|
|
||||||
|
|
||||||
Dir.chdir('cmder')
|
|
||||||
|
|
||||||
FileUtils.rm('Version ' + version.chomp)
|
|
18
packignore
18
packignore
@ -1,8 +1,10 @@
|
|||||||
cmder\launcher
|
launcher
|
||||||
cmder\icons
|
icons
|
||||||
cmder\.gitignore
|
.gitignore
|
||||||
cmder\.gitattributes
|
.gitattributes
|
||||||
cmder\.git
|
.git
|
||||||
cmder\*.rb
|
*.rb
|
||||||
cmder\packignore
|
build
|
||||||
cmder\Cmder.bat
|
config\.history
|
||||||
|
packignore
|
||||||
|
Cmder.bat
|
79
scripts/build.ps1
Normal file
79
scripts/build.ps1
Normal file
@ -0,0 +1,79 @@
|
|||||||
|
<#
|
||||||
|
.Synopsis
|
||||||
|
Build Cmder
|
||||||
|
.DESCRIPTION
|
||||||
|
Use this script to build your own edition of Cmder
|
||||||
|
|
||||||
|
This script builds dependencies from current vendor/sources.json file and unpacks them.
|
||||||
|
|
||||||
|
You will need to make this script executable by setting your Powershell Execution Policy to Remote signed
|
||||||
|
Then unblock the script for execution with UnblockFile .\build.ps1
|
||||||
|
.EXAMPLE
|
||||||
|
.\build.ps1
|
||||||
|
|
||||||
|
Executes the default build for cmder, this is equivalent to the "minimum" style package in the releases
|
||||||
|
.EXAMPLE
|
||||||
|
.\build -verbose
|
||||||
|
|
||||||
|
Execute the build and see what's going on.
|
||||||
|
.EXAMPLE
|
||||||
|
.\build.ps1 -SourcesPath '~/custom/vendors.json'
|
||||||
|
|
||||||
|
Build cmder with your own packages. See vendor/sources.json for the syntax you need to copy.
|
||||||
|
.NOTES
|
||||||
|
AUTHORS
|
||||||
|
Samuel Vasko, Jack Bennett
|
||||||
|
Part of the Cmder project.
|
||||||
|
.LINK
|
||||||
|
https://github.com/bliker/cmder - Project Home
|
||||||
|
#>
|
||||||
|
|
||||||
|
[CmdletBinding(SupportsShouldProcess=$true)]
|
||||||
|
Param(
|
||||||
|
# CmdletBinding will give us;
|
||||||
|
# -verbose switch to turn on logging and
|
||||||
|
# -whatif switch to not actually make changes
|
||||||
|
|
||||||
|
# Path to the vendor configuration source file
|
||||||
|
[string]$sourcesPath = "..\vendor\sources.json",
|
||||||
|
|
||||||
|
# Vendor folder location
|
||||||
|
[string]$saveTo = "..\vendor\",
|
||||||
|
|
||||||
|
# Launcher folder location
|
||||||
|
[string]$launcher = "..\launcher"
|
||||||
|
)
|
||||||
|
|
||||||
|
. "$PSScriptRoot\utils.ps1"
|
||||||
|
$ErrorActionPreference = "Stop"
|
||||||
|
|
||||||
|
Push-Location -Path $saveTo
|
||||||
|
$sources = Get-Content $sourcesPath | Out-String | Convertfrom-Json
|
||||||
|
|
||||||
|
# Check for requirements
|
||||||
|
Ensure-Exists $sourcesPath
|
||||||
|
Ensure-Executable "7z"
|
||||||
|
|
||||||
|
foreach ($s in $sources) {
|
||||||
|
Write-Verbose "Getting $($s.name) from URL $($s.url)"
|
||||||
|
|
||||||
|
# We do not care about the extensions/type of archive
|
||||||
|
$tempArchive = "$($s.name).tmp"
|
||||||
|
Delete-Existing $tempArchive
|
||||||
|
Delete-Existing $s.name
|
||||||
|
|
||||||
|
Invoke-WebRequest -Uri $s.url -OutFile $tempArchive -ErrorAction Stop
|
||||||
|
Extract-Archive $tempArchive $s.name
|
||||||
|
|
||||||
|
if ((Get-Childitem $s.name).Count -eq 1) {
|
||||||
|
Flatten-Directory($s.name)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Pop-Location
|
||||||
|
|
||||||
|
Push-Location -Path $launcher
|
||||||
|
msbuild CmderLauncher.vcxproj /p:configuration=Release
|
||||||
|
Pop-Location
|
||||||
|
|
||||||
|
Write-Verbose "All good and done!"
|
57
scripts/pack.ps1
Normal file
57
scripts/pack.ps1
Normal file
@ -0,0 +1,57 @@
|
|||||||
|
<#
|
||||||
|
.Synopsis
|
||||||
|
Pack cmder
|
||||||
|
.DESCRIPTION
|
||||||
|
Use this script to pack cmder into release archives
|
||||||
|
|
||||||
|
You will need to make this script executable by setting your Powershell Execution Policy to Remote signed
|
||||||
|
Then unblock the script for execution with UnblockFile .\pack.ps1
|
||||||
|
.EXAMPLE
|
||||||
|
.\pack.ps1
|
||||||
|
|
||||||
|
Creates default archives for cmder
|
||||||
|
.EXAMPLE
|
||||||
|
.\build -verbose
|
||||||
|
|
||||||
|
Creates default archives for cmder with plenty of information
|
||||||
|
.NOTES
|
||||||
|
AUTHORS
|
||||||
|
Samuel Vasko, Jack Bennett
|
||||||
|
Part of the Cmder project.
|
||||||
|
.LINK
|
||||||
|
https://github.com/bliker/cmder - Project Home
|
||||||
|
#>
|
||||||
|
|
||||||
|
[CmdletBinding(SupportsShouldProcess=$true)]
|
||||||
|
Param(
|
||||||
|
# CmdletBinding will give us;
|
||||||
|
# -verbose switch to turn on logging and
|
||||||
|
# -whatif switch to not actually make changes
|
||||||
|
|
||||||
|
# Path to the vendor configuration source file
|
||||||
|
[string]$cmderRoot = "..",
|
||||||
|
|
||||||
|
# Vendor folder locaton
|
||||||
|
[string]$saveTo = "..\build"
|
||||||
|
)
|
||||||
|
|
||||||
|
. "$PSScriptRoot\utils.ps1"
|
||||||
|
$ErrorActionPreference = "Stop"
|
||||||
|
Ensure-Executable "7z"
|
||||||
|
|
||||||
|
$targets = @{
|
||||||
|
"cmder.zip" = $null;
|
||||||
|
"cmder.7z" = $null;
|
||||||
|
"cmder_mini.zip" = "-x!`"vendor\msysgit`"";
|
||||||
|
}
|
||||||
|
|
||||||
|
Delete-Existing "..\Version*"
|
||||||
|
|
||||||
|
$version = Invoke-Expression "git describe --abbrev=0 --tags"
|
||||||
|
(New-Item -ItemType file "$cmderRoot\Version $version") | Out-Null
|
||||||
|
|
||||||
|
foreach ($t in $targets.GetEnumerator()) {
|
||||||
|
Create-Archive $cmderRoot "$saveTo\$($t.Name)" $t.Value
|
||||||
|
$hash = (Digest-MD5 "$saveTo\$($t.Name)")
|
||||||
|
Add-Content "$saveTo\hashes.txt" $hash
|
||||||
|
}
|
58
scripts/utils.ps1
Normal file
58
scripts/utils.ps1
Normal file
@ -0,0 +1,58 @@
|
|||||||
|
function Ensure-Exists ($path) {
|
||||||
|
if (-not (Test-Path $path)) {
|
||||||
|
Write-Error "Missing required $path! Ensure it is installed"
|
||||||
|
exit 1
|
||||||
|
}
|
||||||
|
return $true > $null
|
||||||
|
}
|
||||||
|
|
||||||
|
function Ensure-Executable ($command) {
|
||||||
|
try { Get-Command $command -ErrorAction Stop > $null }
|
||||||
|
catch {
|
||||||
|
If( ($command -eq "7z") -and (Test-Path "$env:programfiles\7-zip\7z.exe") ){
|
||||||
|
set-alias -Name "7z" -Value "$env:programfiles\7-zip\7z.exe" -Scope script
|
||||||
|
}
|
||||||
|
ElseIf( ($command -eq "7z") -and (Test-Path "$env:programw6432\7-zip\7z.exe") ) {
|
||||||
|
set-alias -Name "7z" -Value "$env:programw6432\7-zip\7z.exe" -Scope script
|
||||||
|
}
|
||||||
|
Else {
|
||||||
|
Write-Error "Missing $command! Ensure it is installed and on in the PATH"
|
||||||
|
exit 1
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function Delete-Existing ($path) {
|
||||||
|
Write-Verbose "Remove $path"
|
||||||
|
Remove-Item -Recurse -force $path -ErrorAction SilentlyContinue
|
||||||
|
}
|
||||||
|
|
||||||
|
function Extract-Archive ($source, $target) {
|
||||||
|
Invoke-Expression "7z x -y -o$($target) $source > `$null"
|
||||||
|
if ($lastexitcode -ne 0) {
|
||||||
|
Write-Error "Extracting of $source failied"
|
||||||
|
}
|
||||||
|
Remove-Item $source
|
||||||
|
}
|
||||||
|
|
||||||
|
function Create-Archive ($source, $target, $params) {
|
||||||
|
$command = "7z a -x@`"$source\packignore`" $params $target $source > `$null"
|
||||||
|
Write-Verbose "Running: $command"
|
||||||
|
Invoke-Expression $command
|
||||||
|
if ($lastexitcode -ne 0) {
|
||||||
|
Write-Error "Compressing $source failied"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
# If directory contains only one child directory
|
||||||
|
# Flatten it instead
|
||||||
|
function Flatten-Directory ($name) {
|
||||||
|
$child = (Get-Childitem $name)[0]
|
||||||
|
Rename-Item $name -NewName "$($name)_moving"
|
||||||
|
Move-Item -Path "$($name)_moving\$child" -Destination $name
|
||||||
|
Remove-Item -Recurse "$($name)_moving"
|
||||||
|
}
|
||||||
|
|
||||||
|
function Digest-MD5 ($path) {
|
||||||
|
return Invoke-Expression "md5sum $path"
|
||||||
|
}
|
17
vendor/init.bat
vendored
17
vendor/init.bat
vendored
@ -2,6 +2,11 @@
|
|||||||
:: Sets some nice defaults
|
:: Sets some nice defaults
|
||||||
:: Created as part of cmder project
|
:: Created as part of cmder project
|
||||||
|
|
||||||
|
:: Find root dir
|
||||||
|
@if not defined CMDER_ROOT (
|
||||||
|
for /f %%i in ("%ConEmuDir%\..\..") do @set CMDER_ROOT=%%~fi
|
||||||
|
)
|
||||||
|
|
||||||
:: Change the prompt style
|
:: Change the prompt style
|
||||||
:: Mmm tasty lamb
|
:: Mmm tasty lamb
|
||||||
@prompt $E[1;32;40m$P$S{git}$S$_$E[1;30;40m{lamb}$S$E[0m
|
@prompt $E[1;32;40m$P$S{git}$S$_$E[1;30;40m{lamb}$S$E[0m
|
||||||
@ -24,12 +29,18 @@
|
|||||||
|
|
||||||
:: Enhance Path
|
:: Enhance Path
|
||||||
@set git_install_root=%CMDER_ROOT%\vendor\msysgit
|
@set git_install_root=%CMDER_ROOT%\vendor\msysgit
|
||||||
@set PATH=%CMDER_ROOT%\bin;%git_install_root%\bin;%git_install_root%\mingw\bin;%git_install_root%\cmd;%git_install_root%\share\vim\vim73;%PATH%
|
@set PATH=%CMDER_ROOT%\bin;%git_install_root%\bin;%git_install_root%\mingw\bin;%git_install_root%\cmd;%git_install_root%\share\vim\vim74;%CMDER_ROOT%;%PATH%
|
||||||
|
|
||||||
:: Add aliases
|
:: Add aliases
|
||||||
@doskey /macrofile="%CMDER_ROOT%\config\aliases"
|
@doskey /macrofile="%CMDER_ROOT%\config\aliases"
|
||||||
|
|
||||||
:: Set home path
|
:: Set home path
|
||||||
@set HOME=%USERPROFILE%
|
@if not defined HOME set HOME=%USERPROFILE%
|
||||||
|
|
||||||
@if defined CMDER_START cd /d "%CMDER_START%"
|
@if defined CMDER_START (
|
||||||
|
@cd /d "%CMDER_START%"
|
||||||
|
) else (
|
||||||
|
@if "%CD%\" == "%CMDER_ROOT%" (
|
||||||
|
@cd /d "%HOME%"
|
||||||
|
)
|
||||||
|
)
|
||||||
|
17
vendor/sources.json
vendored
Normal file
17
vendor/sources.json
vendored
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
[
|
||||||
|
{
|
||||||
|
"name": "msysgit",
|
||||||
|
"version": "1.9.4-preview",
|
||||||
|
"url": "https://github.com/msysgit/msysgit/releases/download/Git-1.9.4-preview20140611/PortableGit-1.9.4-preview20140611.7z"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "clink",
|
||||||
|
"version": "0.4.2",
|
||||||
|
"url": "https://github.com/mridgers/clink/releases/download/0.4.2/clink_0.4.2.zip"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "conemu-maximus5",
|
||||||
|
"version": "140707",
|
||||||
|
"url": "https://conemu.codeplex.com/downloads/get/880090"
|
||||||
|
}
|
||||||
|
]
|
Reference in New Issue
Block a user