mirror of
https://github.com/denoland/deno.git
synced 2025-03-03 09:31:22 -05:00
deno2: make getcwd() work on windows
This commit is contained in:
parent
a5f53c000a
commit
fb98474239
1 changed files with 7 additions and 1 deletions
|
@ -2,9 +2,14 @@
|
|||
// All rights reserved. MIT License.
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <unistd.h>
|
||||
#include <string>
|
||||
|
||||
#ifdef _WIN32
|
||||
#include <direct.h>
|
||||
#else
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
|
||||
#include "./msg.pb.h"
|
||||
#include "include/deno.h"
|
||||
#include "v8/src/base/logging.h"
|
||||
|
@ -19,6 +24,7 @@ void MessagesFromJS(Deno* d, const char* channel, deno_buf buf) {
|
|||
response.set_command(deno::Msg_Command_START);
|
||||
|
||||
char cwdbuf[1024];
|
||||
// TODO(piscisaureus): support unicode on windows.
|
||||
std::string cwd(getcwd(cwdbuf, sizeof(cwdbuf)));
|
||||
response.set_start_cwd(cwd);
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue