|
@@ -21,6 +21,11 @@ extern TCHAR g_szFna[_MAX_FNAME] = { 0 };
|
|
|
extern TCHAR g_szExt[_MAX_EXT] = { 0 };
|
|
|
extern TCHAR g_szFolderName[MAX_PATH] = { 0 };
|
|
|
|
|
|
+#ifdef DEBUG
|
|
|
+#define RC_DIR _T("F:\\Code\\HS\\SHWS_dev\\SHWS\\")
|
|
|
+#define RC_NAME _T("SHWS")
|
|
|
+#endif
|
|
|
+
|
|
|
void GetDirInfo()
|
|
|
{
|
|
|
TCHAR szDrive[_MAX_DRIVE] = { 0 };
|
|
@@ -35,7 +40,14 @@ void GetDirInfo()
|
|
|
|
|
|
CString strVal = g_szCurModuleDir;
|
|
|
if ( strVal.GetAt(strVal.GetLength()-1) == _T('\\'))
|
|
|
+ {
|
|
|
strVal.Delete(strVal.GetLength()-1);
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ g_szCurModuleDir[sizeof(g_szCurModuleDir)] = '\\';
|
|
|
+ g_szCurModuleDir[sizeof(g_szCurModuleDir) + 1] = '\0';
|
|
|
+ }
|
|
|
|
|
|
int nPos = strVal.ReverseFind(_T('\\'));
|
|
|
if ( nPos != -1 )
|
|
@@ -45,8 +57,8 @@ void GetDirInfo()
|
|
|
}
|
|
|
|
|
|
#ifdef _DEBUG
|
|
|
- _stprintf_s(g_szFolderName, _T("Hartmann"));
|
|
|
- _stprintf_s(g_szCurModuleDir, _T("F:\\Hartmann2\\Hartmann"));
|
|
|
+ _stprintf_s(g_szFolderName, RC_NAME);
|
|
|
+ _stprintf_s(g_szCurModuleDir, RC_DIR);
|
|
|
#endif
|
|
|
|
|
|
// 必须要设置为当前路径为程序路径,因为外部调用者目录不同;
|
|
@@ -209,7 +221,7 @@ int _tmain(int argc, TCHAR* argv[], TCHAR* envp[])
|
|
|
_stprintf_s(szOriginalFilename, _T("%s"), argv[2]);
|
|
|
|
|
|
#ifdef _DEBUG
|
|
|
- CString strValue = StartProcess(NULL, "cmd /c git rev-parse --short HEAD", _T("F:\\Hartmann2\\Hartmann"));
|
|
|
+ CString strValue = StartProcess(NULL, "cmd /c git rev-parse --short HEAD", RC_DIR);
|
|
|
#else
|
|
|
CString strValue = StartProcess(NULL, "cmd /c git rev-parse --short HEAD", NULL);
|
|
|
#endif
|